-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
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.
I can't think of a way to test this, so I'm just going to approve it.
@@ -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> { |
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 is ThinVec
.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what I should put here.
@bors r+ rollup |
📌 Commit 99b49b5 has been approved by |
@@ -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 comment
The 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 comment
The 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:
error: no rules expected the token `}`
--> librustc\ich\impls_hir.rs:208:1
|
208 | });
| ^
error: aborting due to previous error
error: Could not compile `rustc`.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Didnt notice it was in a macro.
Pass attributes to hir::TyParam Required by servo/servo#20264 Discussed here: https://gitter.im/servo/servo?at=5aafdcd1012ff2bf681da97a CC @nikomatsakis
Required by servo/servo#20264
Discussed here: https://gitter.im/servo/servo?at=5aafdcd1012ff2bf681da97a
CC @nikomatsakis