Skip to content

Commit abe0c2d

Browse files
committed
cleanup lower_item_id
1 parent 424c793 commit abe0c2d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/librustc_ast_lowering/item.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
165165
}
166166
ItemKind::MacroDef(..) => SmallVec::new(),
167167
ItemKind::Fn(..) | ItemKind::Impl { of_trait: None, .. } => smallvec![i.id],
168-
ItemKind::Static(ref ty, ..) => {
168+
ItemKind::Static(ref ty, ..) | ItemKind::Const(_, ref ty, ..) => {
169169
let mut ids = smallvec![i.id];
170170
if self.sess.features_untracked().impl_trait_in_bindings {
171-
let mut visitor = ImplTraitTypeIdVisitor { ids: &mut ids };
172-
visitor.visit_ty(ty);
173-
}
174-
ids
175-
}
176-
ItemKind::Const(_, ref ty, ..) => {
177-
let mut ids = smallvec![i.id];
178-
if self.sess.features_untracked().impl_trait_in_bindings {
179-
let mut visitor = ImplTraitTypeIdVisitor { ids: &mut ids };
180-
visitor.visit_ty(ty);
171+
ImplTraitTypeIdVisitor { ids: &mut ids }.visit_ty(ty);
181172
}
182173
ids
183174
}

0 commit comments

Comments
 (0)