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

proc macros 1.1: improve diagnostics #38792

Merged
merged 2 commits into from
Jan 6, 2017

Conversation

jseyfried
Copy link
Contributor

Fixes #38586.
r? @nrc

@jseyfried jseyfried added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 3, 2017
@brson
Copy link
Contributor

brson commented Jan 3, 2017

What do proc macro errors look like after this?

@jseyfried
Copy link
Contributor Author

@brson
This only changes errors that originate from inside a proc_macro_derive-generated bang macro invocation (e.g. println!(...) from the regression test in this PR).

After this PR, these errors will look like other errors in proc_macro_derive-generated code -- they the will be reported at the span of the use site (e.g. A in #[derive(A)] struct S;), c.f. this code.

@nikomatsakis
Copy link
Contributor

@jseyfried can we generate a ui test here?

@nikomatsakis
Copy link
Contributor

Marking as beta-accepted: small diff, important for macros 1.1 usability.

@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 4, 2017
@nikomatsakis
Copy link
Contributor

r=me, but ideally with a ui test

@alexcrichton
Copy link
Member

@bors: p=1

(for when this is approved, we'll want to backport)

@jseyfried jseyfried force-pushed the improve_macros_11_diagnostics branch from fd532a1 to c0bcf5d Compare January 6, 2017 07:44
@jseyfried
Copy link
Contributor Author

Added a ui test.
@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Jan 6, 2017

📌 Commit c0bcf5d has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Jan 6, 2017

⌛ Testing commit c0bcf5d with merge 119ac4b...

@bors
Copy link
Collaborator

bors commented Jan 6, 2017

💔 Test failed - status-travis

@nikomatsakis
Copy link
Contributor

@jseyfried test fails :(

---- [ui] ui/macros/proc_macro_derive.rs stdout ----

	ui: /checkout/src/test/ui/macros/proc_macro_derive.rs

error: auxiliary build of "/checkout/src/test/ui/macros/auxiliary/proc_macro_derive.rs" failed to compile: 

status: exit code: 101

command: /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc /checkout/src/test/ui/macros/auxiliary/proc_macro_derive.rs -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui --target=x86_64-unknown-linux-gnu -L /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/proc_macro_derive.stage2-x86_64-unknown-linux-musl.ui.libaux --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/macros/proc_macro_derive.stage2-x86_64-unknown-linux-musl.ui.libaux -Crpath -O

stdout:

------------------------------------------

------------------------------------------

stderr:

------------------------------------------

error[E0463]: can't find crate for `std`

error: aborting due to previous error

------------------------------------------

thread '[ui] ui/macros/proc_macro_derive.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2465

note: Run with `RUST_BACKTRACE=1` for a backtrace.

failures:

    [ui] ui/macros/proc_macro_derive.rs

@nikomatsakis nikomatsakis mentioned this pull request Jan 6, 2017
17 tasks
@alexcrichton
Copy link
Member

I believe the same failure happened on #38607 which I explained over there

@jseyfried jseyfried force-pushed the improve_macros_11_diagnostics branch from c0bcf5d to fd532a1 Compare January 6, 2017 18:43
@jseyfried
Copy link
Contributor Author

@alexcrichton Thanks!
@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Jan 6, 2017

📌 Commit fd532a1 has been approved by nikomatsakis

@nikomatsakis nikomatsakis mentioned this pull request Jan 6, 2017
6 tasks
@bors
Copy link
Collaborator

bors commented Jan 6, 2017

⌛ Testing commit fd532a1 with merge e447b73...

bors added a commit that referenced this pull request Jan 6, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…omatsakis

proc macros 1.1: improve diagnostics

Fixes #38586.
r? @nrc
@bors
Copy link
Collaborator

bors commented Jan 6, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing e447b73 to master...

@bors bors merged commit fd532a1 into rust-lang:master Jan 6, 2017
@jseyfried jseyfried deleted the improve_macros_11_diagnostics branch January 6, 2017 22:08
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants