Skip to content

Visit attribute tokens in DefCollector and BuildReducedGraphVisitor - #45464

Merged
bors merged 2 commits into
rust-lang:masterfrom
sinkuu:ice_44851
Oct 26, 2017
Merged

bors merged 2 commits into
rust-lang:masterfrom
sinkuu:ice_44851

Conversation

@sinkuu

@sinkuu sinkuu commented Oct 23, 2017

Copy link
Copy Markdown
Contributor

Fixes #44851.

@rust-highfive

Copy link
Copy Markdown
Contributor

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

arielb1 commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

r? @jseyfried

@jseyfried jseyfried left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@sinkuu sinkuu Oct 26, 2017 •

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

@bors r+

@bors

bors commented Oct 26, 2017

Copy link
Copy Markdown
Contributor

📌 Commit 9f1a8bf has been approved by jseyfried

@bors

bors commented Oct 26, 2017

Copy link
Copy Markdown
Contributor

⌛ 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

bors commented Oct 26, 2017

Copy link
Copy Markdown
Contributor

☀️ 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