Skip to content

Commit 25abe48

Browse files
committed
Pass attributes to hir::TyParam
1 parent 75af15e commit 25abe48

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/librustc/hir/lowering.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@ impl<'a> LoweringContext<'a> {
15851585
.filter(|attr| attr.check_name("rustc_synthetic"))
15861586
.map(|_| hir::SyntheticTyParamKind::ImplTrait)
15871587
.nth(0),
1588+
attrs: self.lower_attrs(&tp.attrs),
15881589
}
15891590
}
15901591

src/librustc/hir/map/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ impl<'hir> Map<'hir> {
962962
Some(NodeField(ref f)) => Some(&f.attrs[..]),
963963
Some(NodeExpr(ref e)) => Some(&*e.attrs),
964964
Some(NodeStmt(ref s)) => Some(s.node.attrs()),
965+
Some(NodeTyParam(tp)) => Some(&tp.attrs[..]),
965966
// unit/tuple structs take the attributes straight from
966967
// the struct definition.
967968
Some(NodeStructCtor(_)) => {

src/librustc/hir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ pub struct TyParam {
414414
pub span: Span,
415415
pub pure_wrt_drop: bool,
416416
pub synthetic: Option<SyntheticTyParamKind>,
417+
pub attrs: HirVec<Attribute>,
417418
}
418419

419420
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]

0 commit comments

Comments
 (0)