Skip to content

Commit b8061b8

Browse files
Perform minor cleanup
1 parent 542746e commit b8061b8

File tree

13 files changed

+19
-20
lines changed

13 files changed

+19
-20
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,7 @@ impl ItemKind<'_> {
28442844
ItemKind::Fn(..) => "function",
28452845
ItemKind::Mod(..) => "module",
28462846
ItemKind::ForeignMod { .. } => "extern block",
2847-
ItemKind::Macro { .. } => "macro",
2847+
ItemKind::Macro(..) => "macro",
28482848
ItemKind::GlobalAsm(..) => "global asm item",
28492849
ItemKind::TyAlias(..) => "type alias",
28502850
ItemKind::OpaqueTy(..) => "opaque type",

compiler/rustc_hir/src/target.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Target {
113113
ItemKind::Fn(..) => Target::Fn,
114114
ItemKind::Mod(..) => Target::Mod,
115115
ItemKind::ForeignMod { .. } => Target::ForeignMod,
116-
ItemKind::Macro { .. } => Target::MacroDef,
116+
ItemKind::Macro(..) => Target::MacroDef,
117117
ItemKind::GlobalAsm(..) => Target::GlobalAsm,
118118
ItemKind::TyAlias(..) => Target::TyAlias,
119119
ItemKind::OpaqueTy(..) => Target::OpaqueTy,

compiler/rustc_lint/src/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
617617
return;
618618
}
619619

620-
hir::ItemKind::Macro { .. }
621-
| hir::ItemKind::TyAlias(..)
620+
hir::ItemKind::TyAlias(..)
622621
| hir::ItemKind::Fn(..)
623622
| hir::ItemKind::Mod(..)
623+
| hir::ItemKind::Macro(..)
624624
| hir::ItemKind::Enum(..)
625625
| hir::ItemKind::Struct(..)
626626
| hir::ItemKind::Union(..)

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,7 @@ impl EncodeContext<'a, 'tcx> {
19521952
| hir::ItemKind::Fn(..)
19531953
| hir::ItemKind::Mod(..)
19541954
| hir::ItemKind::ForeignMod { .. }
1955-
| hir::ItemKind::Macro { .. }
1955+
| hir::ItemKind::Macro(..)
19561956
| hir::ItemKind::GlobalAsm(..)
19571957
| hir::ItemKind::ExternCrate(..)
19581958
| hir::ItemKind::Use(..)

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ impl<'hir> Map<'hir> {
228228
ItemKind::ExternCrate(_) => DefKind::ExternCrate,
229229
ItemKind::Use(..) => DefKind::Use,
230230
ItemKind::ForeignMod { .. } => DefKind::ForeignMod,
231-
ItemKind::Macro { .. } => DefKind::Macro(MacroKind::Bang),
231+
ItemKind::Macro(..) => DefKind::Macro(MacroKind::Bang),
232232
ItemKind::GlobalAsm(..) => DefKind::GlobalAsm,
233233
ItemKind::Impl { .. } => DefKind::Impl,
234234
},
@@ -1042,7 +1042,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId) -> String {
10421042
ItemKind::Fn(..) => "fn",
10431043
ItemKind::Mod(..) => "mod",
10441044
ItemKind::ForeignMod { .. } => "foreign mod",
1045-
ItemKind::Macro { .. } => "macro",
1045+
ItemKind::Macro(..) => "macro",
10461046
ItemKind::GlobalAsm(..) => "global asm",
10471047
ItemKind::TyAlias(..) => "ty",
10481048
ItemKind::OpaqueTy(..) => "opaque type",

compiler/rustc_mir/src/monomorphize/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> {
11501150
hir::ItemKind::ExternCrate(..)
11511151
| hir::ItemKind::Use(..)
11521152
| hir::ItemKind::ForeignMod { .. }
1153-
| hir::ItemKind::Macro { .. }
1153+
| hir::ItemKind::Macro(..)
11541154
| hir::ItemKind::TyAlias(..)
11551155
| hir::ItemKind::Trait(..)
11561156
| hir::ItemKind::TraitAlias(..)

compiler/rustc_passes/src/reachable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'tcx> ReachableContext<'tcx> {
264264
| hir::ItemKind::TyAlias(..)
265265
| hir::ItemKind::Mod(..)
266266
| hir::ItemKind::ForeignMod { .. }
267-
| hir::ItemKind::Macro { .. }
267+
| hir::ItemKind::Macro(..)
268268
| hir::ItemKind::Impl { .. }
269269
| hir::ItemKind::Trait(..)
270270
| hir::ItemKind::TraitAlias(..)

compiler/rustc_passes/src/stability.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,11 +613,10 @@ impl<'tcx> Visitor<'tcx> for MissingStabilityAnnotations<'tcx> {
613613
}
614614

615615
fn visit_item(&mut self, i: &'tcx Item<'tcx>) {
616-
// Inherent impls, foreign modules, and non exported macros serve only as
617-
// containers for other items, they don't have their own stability. They still can
618-
// be annotated as unstable and propagate this unstability to children, but this
619-
// annotation is completely optional. They inherit stability from their parents
620-
// when unannotated.
616+
// Inherent impls and foreign modules serve only as containers for other items,
617+
// they don't have their own stability. They still can be annotated as unstable
618+
// and propagate this unstability to children, but this annotation is completely
619+
// optional. They inherit stability from their parents when unannotated.
621620
if !matches!(
622621
i.kind,
623622
hir::ItemKind::Impl(hir::Impl { of_trait: None, .. })

compiler/rustc_privacy/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
778778
// Mark all items in interfaces of reachable items as reachable.
779779
match item.kind {
780780
// The interface is empty.
781-
hir::ItemKind::Macro { .. } | hir::ItemKind::ExternCrate(..) => {}
781+
hir::ItemKind::Macro(..) | hir::ItemKind::ExternCrate(..) => {}
782782

783783
// All nested items are checked by `visit_item`.
784784
hir::ItemKind::Mod(..) => {}
@@ -1988,7 +1988,7 @@ impl<'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'tcx> {
19881988
// Checked in resolve.
19891989
hir::ItemKind::Use(..) => {}
19901990
// No subitems.
1991-
hir::ItemKind::GlobalAsm(..) | hir::ItemKind::Macro { .. } => {}
1991+
hir::ItemKind::Macro(..) | hir::ItemKind::GlobalAsm(..) => {}
19921992
// Subitems of these items have inherited publicity.
19931993
hir::ItemKind::Const(..)
19941994
| hir::ItemKind::Static(..)

compiler/rustc_resolve/src/late/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
742742
| hir::ItemKind::Use(..)
743743
| hir::ItemKind::Mod(..)
744744
| hir::ItemKind::ForeignMod { .. }
745-
| hir::ItemKind::Macro { .. }
745+
| hir::ItemKind::Macro(..)
746746
| hir::ItemKind::GlobalAsm(..) => {
747747
// These sorts of items have no lifetime parameters at all.
748748
intravisit::walk_item(self, item);

0 commit comments

Comments
 (0)