-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Attributes on generic formals #34764
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
📌 Commit 337073b has been approved by |
plugin-breaking, no? |
@bors r- Ah, yes, of course. Thanks @durka. @Manishearth r=me for the next breaking batch or whatnot. |
// When encounter attributes in generics list, do not yet | ||
// know if it is attached to lifetime or to type param. | ||
// | ||
// So we eagerly parsing attributes in tandem with |
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.
Nit: s/parsing/parse
☔ The latest upstream changes (presumably #34113) made this pull request unmergeable. Please resolve the merge conflicts. |
d554c5b
to
2605680
Compare
@@ -198,6 +198,7 @@ pub fn walk_lifetime<V: Visitor>(visitor: &mut V, lifetime: &Lifetime) { | |||
pub fn walk_lifetime_def<V: Visitor>(visitor: &mut V, lifetime_def: &LifetimeDef) { | |||
visitor.visit_lifetime(&lifetime_def.lifetime); | |||
walk_list!(visitor, visit_lifetime, &lifetime_def.bounds); | |||
walk_list!(visitor, visit_attribute, &*lifetime_def.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.
Why deref here, but not with the bounds
?
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.
Its necessary (here and below) because &bounds
is a &Vec
while &attrs
is a &ThinVec
.
Right now, you cannot iterate over a &ThinVec
directly; you need to deref the ThinVec
to turn it into a [T]
slice that you can then iterate over.
I wonder why you used deref with the |
ping @Manishearth |
Oh, you need this merged? Cool, I'll start up a batch. (In the future, for high-pri or generally blocking/bitrotty things, please let me know that that's the case and I'll immediately initiate a breaking batch) |
☔ The latest upstream changes (presumably #35091) made this pull request unmergeable. Please resolve the merge conflicts. |
ping @Manishearth ; did you end up not starting up that batch? |
or maybe I should resolve the merge conflicts. I'll do that now. :) |
The batch happened, but this PR wasn't in it, not sure why :/ |
2605680
to
115b74f
Compare
☔ The latest upstream changes (presumably #36332) made this pull request unmergeable. Please resolve the merge conflicts. |
115b74f
to
3a9b7be
Compare
I am using `ThinAttributes` rather than a vector for attributes attached to generics, since I expect almost all lifetime and types parameters to not carry any attributes.
…ached binding in generics.
ping @Manishearth |
It's in the list. Traveling right now, can't shepherd the rollup |
…r=eddyb First step for rust-lang#34761
First step for #34761