-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove track_errors
from check_match
, typeck_item_bodies
and register_plugins
#59199
Conversation
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
@davidtwco DO NOT APPROVE without agreement from the compiler team. CC @rust-lang/compiler please poke holes at the code. If you can come up with test cases that would break with this change, please post them here so we can properly handle them. An alternative to landing this as is would be to enable it only in nightly to gather information. I would also like to have a crater run. @bors try |
This comment has been minimized.
This comment has been minimized.
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins` In the spirit of continuing through errors in type checking (#39275), remove `track_errors` from a couple of locations in the codebase.
☀️ Try build successful - checks-travis |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@craterbot run start=master#bc44841ad2a2ad5f6c5e67b9e35ed8e7e71d4dc7 end=try#68fcf881bd1e4dbfc21e22f8c7a56b8a5d8e8f7b mode=check-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
eaa69d5
to
a794f7a
Compare
I didn't see any regressions... Would @rust-lang/compiler feel comfortable landing this and letting it ride the release train to catch any potential ICEs? |
if let Err(ErrorReported) = tcx.check_match(def_id) { | ||
return Err(ErrorHandled::Reported) | ||
} | ||
tcx.check_match(def_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this feels pointless, also similar for mir_const_qualif
below.
cc @oli-obk Can we just remove these and rely only on tainted_by_errors
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to remember that building MIR before match checking results in ICEs. Not sure this belongs here though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That shouldn't make sense nowadays, though, there should be no mutable state involved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in check_match
reports errors for match
expressions while MIR building ICEs on those same expressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sure, but that means MIR building should be handling this gracefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you ok with this being addressed in a separate PR? If so, I'll open an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be handled here, as the behavior of "exit if check_match
errored" is gone! You could try to turn an error into an ICE if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I guess I'd be fine with a // FIXME(#...) check_match may have errored but we're not checking for that anymore
here.
let body_id = if let Some(id) = tcx.hir().as_local_hir_id(def_id) { | ||
tcx.hir().body_owned_by(id) | ||
} else { | ||
return Ok(()); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @nikomatsakis Is this intentional? I remember some of the queries I wrote would panic if they got a non-local DefId
.
r=me with nits fixed, I guess? |
r? @eddyb |
For what is worth,
|
@estebank Worst case, you've turned an error into an ICE. Code that compiled is almost impossible to be affected. I'd say we should merge this, so r=me after #59199 (comment) is addressed (just the comment + issue should be enough, seems low-priority). |
a794f7a
to
ffc97cf
Compare
@bors r=eddyb |
📌 Commit ffc97cf3b3621e8f47a2512b822cdcf05950f0bd has been approved by |
ffc97cf
to
5723632
Compare
@bors r=eddyb |
📌 Commit 5723632 has been approved by |
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins` In the spirit of continuing through errors in type checking (rust-lang#39275), remove `track_errors` from a couple of locations in the codebase.
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins` In the spirit of continuing through errors in type checking (#39275), remove `track_errors` from a couple of locations in the codebase.
☀️ Test successful - checks-travis, status-appveyor |
In the spirit of continuing through errors in type checking (#39275), remove
track_errors
from a couple of locations in the codebase.