-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Move promoted MIR out of mir::Body
#63580
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
curious, why didn't the failing tests error before? They should have emitted the Can you adjust the test accordingly? |
8f96a77
to
580b2e2
Compare
Awesome. This is ready now, right? If so, please adjust the PR message |
I believe so. I'm just waiting for the tests to pass. |
r=me once they do |
This comment has been minimized.
This comment has been minimized.
580b2e2
to
0278570
Compare
I ran |
This comment has been minimized.
This comment has been minimized.
0278570
to
da1f679
Compare
This comment has been minimized.
This comment has been minimized.
Is that off by one swapping all the time? Maybe there's some ordering that is randomized via a hashmap iteration? |
da1f679
to
7369726
Compare
I don't think so. I ran the test a bunch of times locally and it consistently failed. I think I just missed adding this change before committing. |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
📌 Commit d6bf776 has been approved by |
Move promoted MIR out of `mir::Body` r? @oli-obk
☀️ Test successful - checks-azure |
Tested on commit rust-lang/rust@555d7a2. Direct link to PR: <rust-lang/rust#63580> 💔 miri on windows: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 miri on linux: test-fail → build-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
Looks like this PR causes ICEs when running the Miri test suite with MIR optimizations. To reproduce, build Miri with a rustc including this PR, and run
Stacktrace
|
…ted, r=oli-obk Resolve some small issues related to rust-lang#63580 This resolves some feedback left on rust-lang#63580 after it was merged: - Adds documentation to `mir::Static` and `mir::StaticKind` - Simplifies `maybe_get_optimized_mir()` and `maybe_get_promoted_mir()` cc @bjorn3 @RalfJung
Rollup of 11 pull requests Successful merges: - #63811 (Correctly suggest adding bounds to `impl Trait` argument) - #63933 (Resolve some small issues related to #63580) - #63938 (or-pattern: fix typo in error message) - #63945 (Recover `mut $pat` and other improvements) - #63958 (const_prop: only call error_to_const_error if we are actually showing something) - #63961 (Add Option<Span> to `require_lang_item`) - #63963 (remove the reference to __cxa_thread_atexit_impl) - #63965 (Prevent syntax error in LD linker version script) - #63968 (rustc_apfloat: make the crate #![no_std] explicitly.) - #63970 (Notify me (flip1995) when Clippy toolstate changes) - #63980 (add missing `#[repr(C)]` on the Slices union) Failed merges: - #63989 (Add Yaah to clippy toolstain notification list) r? @ghost
PR rust-lang#63580 broke miri's ability to run the run-pass test suite with MIR optimizations enabled. The issue was that we weren't properly handling the substs and DefId associated with a Promoted value. This didn't break anything in rustc because in rustc this code runs before the Inliner pass which is where the DefId and substs can diverge from their initial values. It broke Miri though because it ran this code again after running the optimization pass.
…oli-obk Fix const eval bug breaking run-pass tests in Miri PR rust-lang#63580 broke miri's ability to run the run-pass test suite with MIR optimizations enabled. The issue was that we weren't properly handling the substs and DefId associated with a Promoted value. This didn't break anything in rustc because in rustc this code runs before the Inliner pass which is where the DefId and substs can diverge from their initial values. It broke Miri though because it ran this code again after running the optimization pass. r? @oli-obk cc @RalfJung
…oli-obk Fix const eval bug breaking run-pass tests in Miri PR rust-lang#63580 broke miri's ability to run the run-pass test suite with MIR optimizations enabled. The issue was that we weren't properly handling the substs and DefId associated with a Promoted value. This didn't break anything in rustc because in rustc this code runs before the Inliner pass which is where the DefId and substs can diverge from their initial values. It broke Miri though because it ran this code again after running the optimization pass. r? @oli-obk cc @RalfJung
…oli-obk Fix const eval bug breaking run-pass tests in Miri PR rust-lang#63580 broke miri's ability to run the run-pass test suite with MIR optimizations enabled. The issue was that we weren't properly handling the substs and DefId associated with a Promoted value. This didn't break anything in rustc because in rustc this code runs before the Inliner pass which is where the DefId and substs can diverge from their initial values. It broke Miri though because it ran this code again after running the optimization pass. r? @oli-obk cc @RalfJung
|
||
//FIXME(oli-obk): having a `maybe_push()` method on `IndexVec` might be nice | ||
if let Some(promoted) = promoter.promote_candidate(def_id, candidate, promotions.len()) { | ||
promotions.push(promoted); |
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.
Pretty sure you can just use extend
in such situations.
promoter.promote_candidate(candidate); | ||
|
||
//FIXME(oli-obk): having a `maybe_push()` method on `IndexVec` might be nice | ||
if let Some(promoted) = promoter.promote_candidate(def_id, candidate, promotions.len()) { |
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.
Would be nice to pass the IndexVec
key and not an usize
here.
r? @oli-obk