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

rustc_span: return an impl Iterator instead of a Vec from macro_backtrace. #68407

Merged
merged 4 commits into from
Jan 27, 2020

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Jan 20, 2020

Having Span::macro_backtrace produce an impl Iterator<Item = ExpnData> allows #67359 to use it instead of rolling its own similar functionality.

The move from MacroBacktrace to ExpnData (which the first two commits are prerequisites for) both eliminates unnecessary allocations, and is strictly more flexible (exposes more information).

r? @petrochenkov

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 20, 2020
src/librustc_span/hygiene.rs Outdated Show resolved Hide resolved
src/librustc_span/lib.rs Outdated Show resolved Hide resolved
src/librustc_span/hygiene.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 21, 2020
@eddyb
Copy link
Member Author

eddyb commented Jan 21, 2020

@petrochenkov Addressed your comments, does it look good now?

@petrochenkov
Copy link
Contributor

r=me with the clone removed

@eddyb
Copy link
Member Author

eddyb commented Jan 24, 2020

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jan 24, 2020

📌 Commit 43b46aceeb2a41fe95c4d6620e37e23c5d3dfebf has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 24, 2020
@bors
Copy link
Contributor

bors commented Jan 24, 2020

⌛ Testing commit 43b46aceeb2a41fe95c4d6620e37e23c5d3dfebf with merge d47dac1a0628908b7b9de1f8e70f770a1c92b7b9...

@bors

This comment has been minimized.

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 24, 2020
@eddyb

This comment has been minimized.

bors added a commit to rust-lang/cargo that referenced this pull request Jan 24, 2020
test: allow some flexibility in check::error_from_deep_recursion's expected diagnostic.

This should unblock rust-lang/rust#68407, by loosening the expected output pattern.

As per rust-lang/rust#68407 (comment), this is the change in the diagnostic:
```diff
-recursion limit reached while expanding the macro `m`
+recursion limit reached while expanding `m!`
```

Ideally I would use something like this regex:
```
recursion limit reached while expanding (the macro `m`|`m!`)
```
but AFAIK these tests don't support regexes.
@eddyb
Copy link
Member Author

eddyb commented Jan 24, 2020

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jan 24, 2020

📌 Commit 9dec58fc0294d6f7ef896d78fc3dd8efb61f8831 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2020
@bors
Copy link
Contributor

bors commented Jan 24, 2020

⌛ Testing commit 9dec58fc0294d6f7ef896d78fc3dd8efb61f8831 with merge db5e6d5d771b77dfeb0028e3871c9d7a5de75117...

@bors

This comment has been minimized.

@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 24, 2020
@petrochenkov
Copy link
Contributor

Some tests in clippy failed and it's a no tool breakage week.

Marking as waiting on author because some regressions in rustfix tests there look legitimate.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2020
@eddyb

This comment has been minimized.

bors added a commit to rust-lang/rust-clippy that referenced this pull request Jan 26, 2020
Don't use ExpnKind::descr to get the name of a bang macro.

This is the same change as the first commit in rust-lang/rust#68407, but applied to clippy.
The new code should work both before and after the changes in rust-lang/rust#68407.
bors added a commit to rust-lang/rust-clippy that referenced this pull request Jan 26, 2020
Don't use ExpnKind::descr to get the name of a bang macro.

This is the same change as the first commit in rust-lang/rust#68407, but applied to clippy.
The new code should work both before and after the changes in rust-lang/rust#68407.

changelog: none
@eddyb
Copy link
Member Author

eddyb commented Jan 26, 2020

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jan 26, 2020

📌 Commit 6980f82 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 26, 2020
@matthiaskrgr
Copy link
Member

according to the diff, this PR also changes submodules, is this intended?

@eddyb
Copy link
Member Author

eddyb commented Jan 26, 2020

@matthiaskrgr Yupp, see #68407 (comment) and #68407 (comment).

@bors
Copy link
Contributor

bors commented Jan 26, 2020

⌛ Testing commit 6980f82 with merge a237641...

bors added a commit that referenced this pull request Jan 26, 2020
rustc_span: return an impl Iterator instead of a Vec from macro_backtrace.

Having `Span::macro_backtrace` produce an `impl Iterator<Item = ExpnData>` allows #67359 to use it instead of rolling its own similar functionality.

The move from `MacroBacktrace` to `ExpnData` (which the first two commits are prerequisites for) both eliminates unnecessary allocations, and is strictly more flexible (exposes more information).

r? @petrochenkov
@bors
Copy link
Contributor

bors commented Jan 27, 2020

☀️ Test successful - checks-azure
Approved by: petrochenkov
Pushing a237641 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 27, 2020
@bors bors merged commit 6980f82 into rust-lang:master Jan 27, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #68407!

Tested on commit a237641.
Direct link to PR: #68407

🎉 rustc-guide on linux: test-fail → test-pass (cc @JohnTitor @amanjeev @spastorino @mark-i-m, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jan 27, 2020
Tested on commit rust-lang/rust@a237641.
Direct link to PR: <rust-lang/rust#68407>

🎉 rustc-guide on linux: test-fail → test-pass (cc @JohnTitor @amanjeev @spastorino @mark-i-m, @rust-lang/infra).
@eddyb eddyb deleted the iter-macro-backtrace branch January 27, 2020 13:35
@ehuss ehuss mentioned this pull request Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants