Skip to content

Don't leak the compiler's internal representation of scopes in error messages. - #38552

Merged
bors merged 2 commits into
rust-lang:masterfrom
eddyb:bad-blocks
Jan 4, 2017
Merged

Don't leak the compiler's internal representation of scopes in error messages.#38552
bors merged 2 commits into
rust-lang:masterfrom
eddyb:bad-blocks

Conversation

@eddyb

Copy link
Copy Markdown
Contributor

Fixes#37884 (actually fixes#27942, which was made worse by #37412) by handling more node types.
Ideally we'd turn the unknown node type situations into ICEs and fix them as they show up in errors.
But we might want to backport this patch so I was less aggressive.

@eddybeddyb 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 Dec 22, 2016
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@arielb1

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Dec 22, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 25b1d2c has been approved by arielb1

@nikomatsakisnikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Dec 22, 2016
@nikomatsakis

Copy link
Copy Markdown
Contributor

Marked as beta-accepted: regr in diagnostics, low risk change.

@alexcrichton

Copy link
Copy Markdown
Member

@bors: p=1

(beta nominated)

@bors

bors commented Dec 27, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 25b1d2c with merge a1708c2...

@bors

bors commented Dec 27, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@nikomatsakisnikomatsakis self-assigned this Dec 27, 2016
@alexcrichton

alexcrichton commented Dec 27, 2016 via email

Copy link
Copy Markdown
Member

@bors

bors commented Dec 27, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 25b1d2c with merge 9fc4005...

@bors

bors commented Dec 27, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@eddyb

Copy link
Copy Markdown
ContributorAuthor

How can that even happen? It almost sounds like one line was replaced with the previous line, musl bug?

@eddyb

Copy link
Copy Markdown
ContributorAuthor

@bors retry

@bors

bors commented Dec 30, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 25b1d2c with merge abd4aa7...

@bors

bors commented Dec 30, 2016

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@nikomatsakis

Copy link
Copy Markdown
Contributor

@eddyb

looks legitimate

 Compiling rustc v0.0.0 (file:///checkout/src/librustc)
error[E0531]: unresolved tuple struct/variant `hir::MethodTraitItem`
--> /checkout/src/librustc/infer/error_reporting.rs:118:17
|
118 | hir::MethodTraitItem(..) => "method body",
| ^^^^^^^^^^^^^^^^^^^^
error[E0531]: unresolved tuple struct/variant `hir::ConstTraitItem`
--> /checkout/src/librustc/infer/error_reporting.rs:119:17
|
119 | hir::ConstTraitItem(..) |
| ^^^^^^^^^^^^^^^^^^^
error[E0531]: unresolved tuple struct/variant `hir::TypeTraitItem`
--> /checkout/src/librustc/infer/error_reporting.rs:120:17
|
120 | hir::TypeTraitItem(..) => "associated item"
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

@eddyb

eddyb commented Jan 4, 2017

Copy link
Copy Markdown
ContributorAuthor

I think I'll keep changes that are needed solely to make the original patch on master, separate.
At least then the original commit should still apply on beta.

@eddyb

eddyb commented Jan 4, 2017

Copy link
Copy Markdown
ContributorAuthor

@bors r=arielb1

@bors

bors commented Jan 4, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 987f52f has been approved by arielb1

@bors

bors commented Jan 4, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 987f52f with merge e06ce71...

bors added a commit that referenced this pull request Jan 4, 2017
Don't leak the compiler's internal representation of scopes in error messages.
Fixes#37884 (actually fixes#27942, which was made worse by #37412) by handling more node types.
Ideally we'd turn the unknown node type situations into ICEs and fix them as they show up in errors.
But we might want to backport this patch so I was less aggressive.
@bors

bors commented Jan 4, 2017

Copy link
Copy Markdown
Collaborator

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

@bors
bors merged commit 987f52f into rust-lang:masterJan 4, 2017
@eddyb
eddyb deleted the bad-blocks branch January 4, 2017 10:38
@alexcrichton

Copy link
Copy Markdown
Member

@eddyb this PR backports cleanly to beta but then results in a build failure. Can you investigate backporting to beta?

@eddyb

eddyb commented Jan 6, 2017

Copy link
Copy Markdown
ContributorAuthor

@alexcrichton Do you have the build failure?

@alexcrichton

Copy link
Copy Markdown
Member

@eddyb unfortunately no

@nikomatsakisnikomatsakis mentioned this pull request Jan 6, 2017
17 tasks
@alexcrichtonalexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-acceptedAccepted for backporting to the compiler in the beta channel.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

7 participants

@eddyb@rust-highfive@arielb1@bors@nikomatsakis@alexcrichton@pnkfelix