-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsI-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.
Milestone
Description
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:
% build/x86_64-apple-darwin/stage1/bin/rustc -Z borrowck-mir \
../src/test/compile-fail/borrowck/borrowck-for-loop-head-linkage.rs
[...]
error[E0384]: re-assignment of immutable variable `val` (Mir)
--> ../src/test/compile-fail/borrowck/borrowck-for-loop-head-linkage.rs:15:5
|
15 | for &x in &vector {
| _____^
| |_____|
| ||
16 | || let cap = vector.capacity();
17 | || vector.extend(repeat(0)); //~ ERROR cannot borrow
18 | || vector[1] = 5; //~ ERROR cannot borrow
19 | || }
| || ^
| ||_____|
| |______re-assignment of immutable variable
| first assignment to `val`
error[E0384]: re-assignment of immutable variable `x` (Mir)
--> ../src/test/compile-fail/borrowck/borrowck-for-loop-head-linkage.rs:15:10
|
15 | for &x in &vector {
| ^
| |
| re-assignment of immutable variable
| first assignment to `x`
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.22.0-dev running on x86_64-apple-darwin
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /Users/fklock/Dev/Mozilla/rust.git/src/libcore/option.rs:335:20
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsI-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.