about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMrowqa <artur.jamro@gmail.com>2018-03-20 22:12:31 +0100
committerMrowqa <artur.jamro@gmail.com>2018-03-20 22:12:31 +0100
commit25abe4830769e7bfceff75dc27d443c6d625fe13 (patch)
treeac06599aa76a3cd4f1b8973ec828a05cd57eed7d /src
parent75af15ee6ca0c12b699a17984b033363cd25e9c3 (diff)
downloadrust-25abe4830769e7bfceff75dc27d443c6d625fe13.tar.gz
rust-25abe4830769e7bfceff75dc27d443c6d625fe13.zip
Pass attributes to hir::TyParam
Diffstat (limited to 'src')
-rw-r--r--src/librustc/hir/lowering.rs1
-rw-r--r--src/librustc/hir/map/mod.rs1
-rw-r--r--src/librustc/hir/mod.rs1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 1439410f7e9..a35af56bd97 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -1585,6 +1585,7 @@ impl<'a> LoweringContext<'a> {
                                .filter(|attr| attr.check_name("rustc_synthetic"))
                                .map(|_| hir::SyntheticTyParamKind::ImplTrait)
                                .nth(0),
+            attrs: self.lower_attrs(&tp.attrs),
         }
     }
 
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs
index 61fae4609d5..e8bcbfbb77a 100644
--- a/src/librustc/hir/map/mod.rs
+++ b/src/librustc/hir/map/mod.rs
@@ -962,6 +962,7 @@ impl<'hir> Map<'hir> {
             Some(NodeField(ref f)) => Some(&f.attrs[..]),
             Some(NodeExpr(ref e)) => Some(&*e.attrs),
             Some(NodeStmt(ref s)) => Some(s.node.attrs()),
+            Some(NodeTyParam(tp)) => Some(&tp.attrs[..]),
             // unit/tuple structs take the attributes straight from
             // the struct definition.
             Some(NodeStructCtor(_)) => {
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs
index 5ae84f5685e..d6810b2468b 100644
--- a/src/librustc/hir/mod.rs
+++ b/src/librustc/hir/mod.rs
@@ -414,6 +414,7 @@ pub struct TyParam {
     pub span: Span,
     pub pure_wrt_drop: bool,
     pub synthetic: Option<SyntheticTyParamKind>,
+    pub attrs: HirVec<Attribute>,
 }
 
 #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]