-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Visit attribute tokens in DefCollector
and BuildReducedGraphVisitor
#45464
Conversation
…ducedGraphVisitor`
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (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. |
DefCollector
and BuildReducedGraphVisitor
DefCollector
and BuildReducedGraphVisitor
r? @jseyfried |
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.
Great, thanks!
r=me modulo comment
if let Token::Interpolated(nt) = t { | ||
match nt.0 { | ||
token::NtExpr(ref expr) => { | ||
if let ExprKind::Mac(..) = expr.node { |
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 believe this should just be token::Expr(ref expr) => self.visit_expr(expr),
.
Ideally, we'd add visit_interpolated
and walk_interpolated
(a la https://github.com/sinkuu/rust/blob/c0ccab4c2330659b67edb5889d7f9ee702aebbe3/src/libsyntax/fold.rs#L618) -- could you add a FIXME for this?
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.
It should, but doesn't work due to lifetimes:(
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 believe you can fix the lifetime error by chaging fn visit_token
to take the token by reference instead of by value.
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.
Wait, nvm -- you can get a reference to the token with an appropriate lifetime from a token stream, so that won't work. I think what you have is fine for now.
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.
(comment removed)
Nvm, I didn't reload the browser
@bors r+ |
📌 Commit 9f1a8bf has been approved by |
Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor` Fixes #44851.
☀️ Test successful - status-appveyor, status-travis |
Fixes #44851.