cleanup lower_item_id

This commit is contained in:
Mazdak Farrokhzad 2020-04-03 15:39:35 +02:00
parent 424c793925
commit abe0c2de43

View File

@ -165,19 +165,10 @@ pub(super) fn lower_mod(&mut self, m: &Mod) -> hir::Mod<'hir> {
}
ItemKind::MacroDef(..) => SmallVec::new(),
ItemKind::Fn(..) | ItemKind::Impl { of_trait: None, .. } => smallvec![i.id],
ItemKind::Static(ref ty, ..) => {
ItemKind::Static(ref ty, ..) | ItemKind::Const(_, ref ty, ..) => {
let mut ids = smallvec![i.id];
if self.sess.features_untracked().impl_trait_in_bindings {
let mut visitor = ImplTraitTypeIdVisitor { ids: &mut ids };
visitor.visit_ty(ty);
}
ids
}
ItemKind::Const(_, ref ty, ..) => {
let mut ids = smallvec![i.id];
if self.sess.features_untracked().impl_trait_in_bindings {
let mut visitor = ImplTraitTypeIdVisitor { ids: &mut ids };
visitor.visit_ty(ty);
ImplTraitTypeIdVisitor { ids: &mut ids }.visit_ty(ty);
}
ids
}