Skip to content
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

Merged
merged 2 commits into from
Oct 26, 2017

Conversation

sinkuu
Copy link
Contributor

@sinkuu sinkuu commented Oct 23, 2017

Fixes #44851.

@rust-highfive
Copy link
Collaborator

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.

@sinkuu sinkuu changed the title Visit tokens in DefCollector and BuildReducedGraphVisitor Visit attribute tokens in DefCollector and BuildReducedGraphVisitor Oct 23, 2017
@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2017
@arielb1
Copy link
Contributor

arielb1 commented Oct 24, 2017

r? @jseyfried

Copy link
Contributor

@jseyfried jseyfried left a 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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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:(

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@sinkuu sinkuu Oct 26, 2017

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

@jseyfried
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 26, 2017

📌 Commit 9f1a8bf has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Oct 26, 2017

⌛ Testing commit 9f1a8bf with merge 56dc171...

bors added a commit that referenced this pull request Oct 26, 2017
Visit attribute tokens in `DefCollector` and `BuildReducedGraphVisitor`

Fixes #44851.
@bors
Copy link
Contributor

bors commented Oct 26, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: jseyfried
Pushing 56dc171 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants