-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-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.
Description
The compiler correctly errors about the ambiguous types, but also panics on this code:
use arrayvec::ArrayVec;
fn main() {
let mut buffer = ArrayVec::new();
let x = buffer.last().unwrap().0.clone();
buffer.reverse();
}
error[E0282]: type annotations needed
--> src/main.rs:5:13
|
5 | let x = buffer.last().unwrap().0.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for `T`
|
= note: type must be known at this point
error[E0609]: no field `0` on type `&_`
--> src/main.rs:5:36
|
5 | let x = buffer.last().unwrap().0.clone();
| ^
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-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.