Skip to content

Fix macro expansion backtrace diagnostics - #33730

Merged
bors merged 1 commit into
rust-lang:masterfrom
jseyfried:fix_macro_backtrace_diagnostics
May 19, 2016
Merged

Fix macro expansion backtrace diagnostics#33730
bors merged 1 commit into
rust-lang:masterfrom
jseyfried:fix_macro_backtrace_diagnostics

Conversation

@jseyfried

@jseyfriedjseyfried commented May 19, 2016

Copy link
Copy Markdown
Contributor

@jseyfried

Copy link
Copy Markdown
ContributorAuthor

For example, consider:

macro_rules! m {() => {{ error }}}fnmain(){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
Copy Markdown
Contributor

@jseyfried can we add a test for this?

@jseyfried

Copy link
Copy Markdown
ContributorAuthor

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

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented May 19, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit f8e9c15 has been approved by nikomatsakis

@nikomatsakis

Copy link
Copy Markdown
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
Fixesrust-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:masterMay 19, 2016
Sign up for freeto 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

@jseyfried@nikomatsakis@bors