Repository navigation
MIR-borrowck: ICE during diagnostic search for assignment (unwrap of None) #45199
Description
Activity
- addedI-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.
on Oct 11, 2017 Its worth noting that the diagnostic reported by AST-borrowck is very different from that for MIR-borrowck. This is almost certainly because the MIR-borrowck is seeing a desugared for-loop (and thus we're seeing reports of an assignment to
valthat does not actually occur in the surface level syntax.Nonetheless, part of resolving this bug might include trying figure out how to make the MIR-borrowck diagnostic more understandable to the end user in this scenario.
- addedA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
on Oct 11, 2017 (another approach that I did not consider earlier: Change the MIR construction to accommodate
for-loops. E.g. maybe the MIR assignment statement could take a flag indicating that it is an assignment arising fromfor-desugaring, and thus it is "safe" even when it is reassigning a variable declared withoutmut...)- changed the title
[-]MIR-borrowck: ICE during diagnostic search for assignment[/-][+]MIR-borrowck: ICE during diagnostic search for assignment (unwrap of None)[/+]on Nov 1, 2017 Working on this (and this error message in general)
@matthewjasper nice! please stop in on gitter with any questions, if you've not done so already.
Minified case (that still ICEs after #45936)
fn main() { let x = String::new(); x = String::new(); }
- added a commit that references this issue
on Nov 27, 2017 - added a commit that references this issue
on Nov 27, 2017
PR #44806 added some code to search for the lexically first assignment in order to report an illegal assignment.
However, oddly enough, for some tests this search, which ends in an
unwrap, is causing the compiler to ICE.For example: