Skip to content

Commit 2827007

Browse files
committed
Drop vis from ForeignItem.
1 parent a62680d commit 2827007

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
773773
ForeignItemKind::TyAlias(..) => hir::ForeignItemKind::Type,
774774
ForeignItemKind::MacCall(_) => panic!("macro shouldn't exist here"),
775775
},
776-
vis: self.lower_visibility(&i.vis),
776+
vis_span: self.lower_span(i.vis.span),
777777
span: self.lower_span(i.span),
778778
};
779779
self.arena.alloc(item)

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,7 +3002,7 @@ pub struct ForeignItem<'hir> {
30023002
pub kind: ForeignItemKind<'hir>,
30033003
pub def_id: LocalDefId,
30043004
pub span: Span,
3005-
pub vis: Visibility<'hir>,
3005+
pub vis_span: Span,
30063006
}
30073007

30083008
impl ForeignItem<'_> {
@@ -3351,5 +3351,5 @@ mod size_asserts {
33513351
rustc_data_structures::static_assert_size!(super::Item<'static>, 184);
33523352
rustc_data_structures::static_assert_size!(super::TraitItem<'static>, 128);
33533353
rustc_data_structures::static_assert_size!(super::ImplItem<'static>, 144);
3354-
rustc_data_structures::static_assert_size!(super::ForeignItem<'static>, 136);
3354+
rustc_data_structures::static_assert_size!(super::ForeignItem<'static>, 112);
33553355
}

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ impl<'tcx> LateLintPass<'tcx> for UnreachablePub {
14261426

14271427
fn check_foreign_item(&mut self, cx: &LateContext<'_>, foreign_item: &hir::ForeignItem<'tcx>) {
14281428
if cx.tcx.visibility(foreign_item.def_id).is_public() {
1429-
self.perform_lint(cx, "item", foreign_item.def_id, foreign_item.vis.span, true);
1429+
self.perform_lint(cx, "item", foreign_item.def_id, foreign_item.vis_span, true);
14301430
}
14311431
}
14321432

0 commit comments

Comments
 (0)