-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass attributes to hir::TyParam #49242
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -809,7 +809,7 @@ impl<'a> LoweringContext<'a> { | |
} | ||
} | ||
|
||
fn lower_attrs(&mut self, attrs: &Vec<Attribute>) -> hir::HirVec<Attribute> { | ||
fn lower_attrs(&mut self, attrs: &[Attribute]) -> hir::HirVec<Attribute> { | ||
attrs.iter().map(|a| self.lower_attr(a)).collect::<Vec<_>>().into() | ||
} | ||
|
||
|
@@ -1019,6 +1019,7 @@ impl<'a> LoweringContext<'a> { | |
span, | ||
pure_wrt_drop: false, | ||
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait), | ||
attrs: P::new(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what I should put here. |
||
}); | ||
|
||
hir::TyPath(hir::QPath::Resolved(None, P(hir::Path { | ||
|
@@ -1585,6 +1586,7 @@ impl<'a> LoweringContext<'a> { | |
.filter(|attr| attr.check_name("rustc_synthetic")) | ||
.map(|_| hir::SyntheticTyParamKind::ImplTrait) | ||
.nth(0), | ||
attrs: self.lower_attrs(&tp.attrs), | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,8 @@ impl_stable_hash_for!(struct hir::TyParam { | |
default, | ||
span, | ||
pure_wrt_drop, | ||
synthetic | ||
synthetic, | ||
attrs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add trailing comma There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is inside macro which requires no trailing comma. Otherwise it fails to compile with:
You can look around this place in code - other calls to this macro don't have trailing commas. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didnt notice it was in a macro. |
||
}); | ||
|
||
impl_stable_hash_for!(enum hir::GenericParam { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cause
tp.attrs
below isThinVec
.