1
Fork 0

Add #[rustc_legacy_const_generics]

This commit is contained in:
Amanieu d'Antras 2021-02-23 15:12:28 +00:00
parent 9b471a3f5f
commit d87eec1bf6
11 changed files with 310 additions and 2 deletions

View file

@ -175,6 +175,8 @@ pub trait ResolverAstLowering {
fn item_generics_num_lifetimes(&self, def: DefId, sess: &Session) -> usize;
fn item_attrs(&self, def_id: DefId, sess: &Session) -> Vec<ast::Attribute>;
/// Obtains resolution for a `NodeId` with a single resolution.
fn get_partial_res(&mut self, id: NodeId) -> Option<PartialRes>;
@ -2826,6 +2828,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
)
}
}
fn item_attrs(&self, def_id: DefId) -> Vec<ast::Attribute> {
if let Some(_local_def_id) = def_id.as_local() {
// TODO: This doesn't actually work, items doesn't include everything?
//self.items[&hir::ItemId { def_id: local_def_id }].attrs.into()
Vec::new()
} else {
self.resolver.item_attrs(def_id, self.sess)
}
}
}
fn body_ids(bodies: &BTreeMap<hir::BodyId, hir::Body<'_>>) -> Vec<hir::BodyId> {