Skip to content

Commit 60c3bbd

Browse files
committed
Formatting.
1 parent 51d1024 commit 60c3bbd

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

compiler/rustc_hir/src/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ macro_rules! arena_types {
2929
[] field_pat: rustc_hir::FieldPat<$tcx>,
3030
[] fn_decl: rustc_hir::FnDecl<$tcx>,
3131
[] foreign_item: rustc_hir::ForeignItem<$tcx>,
32-
[] foreign_item_ref: rustc_hir::ForeignItemRef<$tcx>,
32+
[few] foreign_item_ref: rustc_hir::ForeignItemRef<$tcx>,
3333
[] impl_item_ref: rustc_hir::ImplItemRef<$tcx>,
3434
[few] inline_asm: rustc_hir::InlineAsm<$tcx>,
3535
[few] llvm_inline_asm: rustc_hir::LlvmInlineAsm<$tcx>,

compiler/rustc_hir/src/hir.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ pub struct FnSig<'hir> {
18551855
}
18561856

18571857
// The bodies for items are stored "out of line", in a separate
1858-
// hashmap in the `Crate`. Here we just record the node-id of the item
1858+
// hashmap in the `Crate`. Here we just record the hir-id of the item
18591859
// so it can fetched later.
18601860
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)]
18611861
pub struct TraitItemId {
@@ -1899,7 +1899,7 @@ pub enum TraitItemKind<'hir> {
18991899
}
19001900

19011901
// The bodies for items are stored "out of line", in a separate
1902-
// hashmap in the `Crate`. Here we just record the node-id of the item
1902+
// hashmap in the `Crate`. Here we just record the hir-id of the item
19031903
// so it can fetched later.
19041904
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)]
19051905
pub struct ImplItemId {
@@ -2441,7 +2441,7 @@ impl VariantData<'hir> {
24412441
}
24422442

24432443
// The bodies for items are stored "out of line", in a separate
2444-
// hashmap in the `Crate`. Here we just record the node-id of the item
2444+
// hashmap in the `Crate`. Here we just record the hir-id of the item
24452445
// so it can fetched later.
24462446
#[derive(Copy, Clone, Encodable, Debug)]
24472447
pub struct ItemId {
@@ -2624,7 +2624,7 @@ pub enum AssocItemKind {
26242624
}
26252625

26262626
// The bodies for items are stored "out of line", in a separate
2627-
// hashmap in the `Crate`. Here we just record the node-id of the item
2627+
// hashmap in the `Crate`. Here we just record the hir-id of the item
26282628
// so it can fetched later.
26292629
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Debug)]
26302630
pub struct ForeignItemId {

compiler/rustc_hir/src/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub trait Visitor<'v>: Sized {
289289
walk_list!(self, visit_impl_item, opt_item);
290290
}
291291

292-
/// Like `visit_nested_item()`, but for impl items. See
292+
/// Like `visit_nested_item()`, but for foreign items. See
293293
/// `visit_nested_item()` for advice on when to override this
294294
/// method.
295295
fn visit_nested_foreign_item(&mut self, id: ForeignItemId) {

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ impl EncodeContext<'a, 'tcx> {
12251225
hir::ItemKind::Mod(ref m) => {
12261226
return self.encode_info_for_mod(item.hir_id, m, &item.attrs);
12271227
}
1228-
hir::ItemKind::ForeignMod{..} => EntryKind::ForeignMod,
1228+
hir::ItemKind::ForeignMod { .. } => EntryKind::ForeignMod,
12291229
hir::ItemKind::GlobalAsm(..) => EntryKind::GlobalAsm,
12301230
hir::ItemKind::TyAlias(..) => EntryKind::Type,
12311231
hir::ItemKind::OpaqueTy(..) => {

compiler/rustc_passes/src/entry.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for EntryContext<'a, 'tcx> {
4646
// Entry fn is never a trait item.
4747
}
4848

49-
fn visit_foreign_item(&mut self, _: &'tcx ForeignItem<'tcx>) {}
49+
fn visit_foreign_item(&mut self, _: &'tcx ForeignItem<'tcx>) {
50+
// Entry fn is never a foreign item.
51+
}
5052
}
5153

5254
fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(LocalDefId, EntryFnType)> {

compiler/rustc_passes/src/reachable.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx
379379
// processed in visit_item above
380380
}
381381

382-
fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {}
382+
fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {
383+
// We never export foreign functions as they have no body to export.
384+
}
383385
}
384386

385387
fn reachable_set<'tcx>(tcx: TyCtxt<'tcx>, crate_num: CrateNum) -> FxHashSet<LocalDefId> {

compiler/rustc_passes/src/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
499499
// optional. They inherit stability from their parents when unannotated.
500500
if !matches!(
501501
i.kind,
502-
hir::ItemKind::Impl { of_trait: None, .. } | hir::ItemKind::ForeignMod{..}
502+
hir::ItemKind::Impl { of_trait: None, .. } | hir::ItemKind::ForeignMod { .. }
503503
) {
504504
self.check_missing_stability(i.hir_id, i.span);
505505
}

0 commit comments

Comments
 (0)