Description
There are many tests in compile-fail/borrowck/
that ICE with the same failure: "broken MIR moving out of Lvalue"
- You can see list of such tests in the discrepancy spreadsheet.
- But for ease of reference, I am also transcribing that list into the first comment on this issue.
pnkfelix believes the origin of this problem is that some code processing MIR (probably MIR dataflow) was written under the assumption that all valid MIR will not have moves out of Lvalues, at least for non-Copy
values. But of course such an assumption only holds for MIR that has actually passed the borrowck analysis (at least under our current separation of concerns in the static analyses of rustc
), and therefore any dataflow code running prior to borrowck on some (erroneous) Rust source file is going to potentially encounter such MIR.
- Zoxc has pointed out that it is probably
librustc_mir/dataflow/move_paths/builder.rs
that is the culprit here.
The answer here is not to panic from rustc
, but instead to fail gracefully in some manner and report a nice error diagnostic to the user.