You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Broken MIR: generator contains type ... after copy & destination propagation #76375
$ rustc --edition=2018 -Zmir-opt-level=2 x.rs -Zunsound-mir-opts x.rs
$ rustc --edition=2018 -Zmir-opt-level=2 y.rs --extern x -L.error: internal compiler error: src/librustc_mir/transform/generator.rs:752:13: Broken MIR: generator contains type std::string::String in MIR, but typeck only knows about {std::future::ResumeTy, impl std::future::Future, ()}
The copy propagation removes storage markers during optimization. Afterwards state transforms considers them to be always live across yield. Due to pass ordering, requires inliner to expose the issue.
changed the title [-]Broken MIR: generator contains type ... after copy propagation[/-][+]Broken MIR: generator contains type ... after copy & destination propagation[/+]on Sep 21, 2020
For copy propagation this is still an issue, but the test case now requires -Zunsound-mir-opts.
For destination propagation the test case was fixed after changes that stop propagation if either local was ever borrowed. Hard to say if this fixed the issue more generally.
Activity
[-]Broken MIR: generator contains type ... after copy propagation[/-][+]Broken MIR: generator contains type ... after copy & destination propagation[/+]JohnTitor commentedon Sep 29, 2020
The ICE is no longer reproduced with the latest nightly on glacier, marking as
E-needs-test.tmiasko commentedon Sep 29, 2020
For copy propagation this is still an issue, but the test case now requires
-Zunsound-mir-opts.For destination propagation the test case was fixed after changes that stop propagation if either local was ever borrowed. Hard to say if this fixed the issue more generally.
JohnTitor commentedon Sep 30, 2020
@tmiasko Thanks for the heads-up!
Submitted a PR to readd this: rust-lang/glacier#479
JohnTitor commentedon Oct 19, 2020
Triage: It's now compiled fine (again) with the latest nightly (I'd say it's finally fixed by #77306).
Rollup merge of rust-lang#78133 - JohnTitor:mir-tests, r=lcnr
Rollup merge of rust-lang#78133 - JohnTitor:mir-tests, r=lcnr
Rollup merge of rust-lang#79027 - tmiasko:inline-always-live-locals, …
Rollup merge of rust-lang#79027 - tmiasko:inline-always-live-locals, …