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 ICE when querying DefId on Def::Err. #37564

Merged
merged 1 commit into from
Nov 6, 2016

Conversation

Mark-Simulacrum
Copy link
Member

Also moves computations into check that kind_id is Ok(_), which is in theory an optimization, though I expect it's minor.

Fixes #37534.

r? @eddyb.

@petrochenkov
Copy link
Contributor

Test?

@Mark-Simulacrum
Copy link
Member Author

Yeah, I need to add that. Where should it go?

@petrochenkov
Copy link
Contributor

compile-fail
it'll fail on ICE, but pass on an expected error

if let Ok(kind_id) = kind_id {
let trait_def = tcx.expect_def(tpb.ref_id);
if trait_def != Def::Trait(kind_id) {
if trait_def.def_id() != kind_id {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed, the line above it replaces it.

@eddyb
Copy link
Member

eddyb commented Nov 3, 2016

@Mark-Simulacrum compile-fail with the original bug report code - the test will succeed if the errors listed in it are found, but fail if there's an ICE or any other crash.

@Mark-Simulacrum
Copy link
Member Author

Okay, fixed nits, but I don't know how to fix tidy warning on the long line in compile-fail.

@Mark-Simulacrum
Copy link
Member Author

Oh, okay, turns out you can just truncate the error message. Let me know if that's the expected approach. Otherwise I think this is done. r? @eddyb

@eddyb
Copy link
Member

eddyb commented Nov 3, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Nov 3, 2016

📌 Commit d5f72d2 has been approved by eddyb

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Nov 4, 2016
Fix ICE when querying DefId on Def::Err.

Also moves computations into check that `kind_id` is `Ok(_)`, which is in theory an optimization, though I expect it's minor.

Fixes rust-lang#37534.

r? @eddyb.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 4, 2016
Fix ICE when querying DefId on Def::Err.

Also moves computations into check that `kind_id` is `Ok(_)`, which is in theory an optimization, though I expect it's minor.

Fixes rust-lang#37534.

r? @eddyb.
bors added a commit that referenced this pull request Nov 5, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this pull request Nov 5, 2016
Fix ICE when querying DefId on Def::Err.

Also moves computations into check that `kind_id` is `Ok(_)`, which is in theory an optimization, though I expect it's minor.

Fixes rust-lang#37534.

r? @eddyb.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 5, 2016
Fix ICE when querying DefId on Def::Err.

Also moves computations into check that `kind_id` is `Ok(_)`, which is in theory an optimization, though I expect it's minor.

Fixes rust-lang#37534.

r? @eddyb.
bors added a commit that referenced this pull request Nov 6, 2016
@bors bors merged commit d5f72d2 into rust-lang:master Nov 6, 2016
@Mark-Simulacrum Mark-Simulacrum deleted the sized-ice branch December 27, 2016 00:30
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.

4 participants