Pass attributes to hir::TyParam

This commit is contained in:
Mrowqa 2018-03-20 22:12:31 +01:00
parent 75af15ee6c
commit 25abe48307
3 changed files with 3 additions and 0 deletions

View file

@ -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),
}
}

View file

@ -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(_)) => {

View file

@ -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)]