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

Fix macro expansion backtrace diagnostics #33730

Merged
merged 1 commit into from
May 19, 2016

Conversation

jseyfried
Copy link
Contributor

@jseyfried jseyfried commented May 19, 2016

Fixes #33704.
r? @nikomatsakis

@jseyfried
Copy link
Contributor Author

For example, consider:

macro_rules! m {
    () => { { error } }
}
fn main() { m!(); }

Currently, the diagnostics are:

bt.rs:2     () => { { error } }
                      ^~~~~
bt.rs:2:15: 2:20 note: in this expansion of m! (defined in bt.rs)
bt.rs:2:15: 2:20 help: run `rustc --explain E0425` to see a detailed explanation

After this PR, the diagnostics will be the same as on beta:

bt.rs:2:15: 2:20 error: unresolved name `error` [E0425]
bt.rs:2     () => { { error } }
                      ^~~~~
bt.rs:4:13: 4:18 note: in this expansion of m! (defined in bt.rs)
bt.rs:2:15: 2:20 help: run `rustc --explain E0425` to see a detailed explanation

@nikomatsakis
Copy link
Contributor

@jseyfried can we add a test for this?

@jseyfried
Copy link
Contributor Author

@nikomatsakis I don't know -- I'm not very familiar with the recent changes to the testing framework.

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 19, 2016

📌 Commit f8e9c15 has been approved by nikomatsakis

@nikomatsakis
Copy link
Contributor

we could make a ui test, but maybe not worth it -- @jonathandturner and I did plan to revisit how macro backtraces are presented, maybe we'll do it then

Manishearth added a commit to Manishearth/rust that referenced this pull request May 19, 2016
…ostics, r=nikomatsakis

Fix macro expansion backtrace diagnostics

Fixes rust-lang#33704.
r? @nikomatsakis
bors added a commit that referenced this pull request May 19, 2016
Rollup of 10 pull requests

- Successful merges: #33353, #33611, #33696, #33698, #33705, #33708, #33712, #33720, #33721, #33730
- Failed merges:
@bors bors merged commit f8e9c15 into rust-lang:master May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants