about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/lib.rs
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2021-02-23 15:12:28 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2021-02-23 17:25:55 +0000
commitd87eec1bf67959977c8ebaadc2ddcf4bdc14658a (patch)
tree1f777c2c1702ec27d57c346a8c9f7c1b876df372 /compiler/rustc_ast_lowering/src/lib.rs
parent9b471a3f5fe57e5c6e08acf665f2094422415a3d (diff)
downloadrust-d87eec1bf67959977c8ebaadc2ddcf4bdc14658a.tar.gz
rust-d87eec1bf67959977c8ebaadc2ddcf4bdc14658a.zip
Add #[rustc_legacy_const_generics]
Diffstat (limited to 'compiler/rustc_ast_lowering/src/lib.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 05b417effd4..4a438541211 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -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> {