-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
MIR-borrowck: ICE: broken MIR moving out of Lvalue #44830
Copy link
Copy link
Closed
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-borrow-checkerArea: The borrow checkerArea: The borrow checkerC-bugCategory: This is a bug.Category: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
There are many tests in
compile-fail/borrowck/that ICE with the same failure: "broken MIR moving out of Lvalue"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-
Copyvalues. 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 ofrustc), and therefore any dataflow code running prior to borrowck on some (erroneous) Rust source file is going to potentially encounter such MIR.librustc_mir/dataflow/move_paths/builder.rsthat 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.