rust
rust copied to clipboard
ICE with slice in a generic struct
The following code causes an internal compiler error:
fn foo<T>() {
let _x: Bar<T> = Bar{ arr: &[] };
}
struct Bar<T> {
arr: &[T],
}
fn test_foo() {
foo::<()>();
}
Switching the &[T] to a Option<T> makes it go away.
Backtrace here: https://gist.github.com/3924593
This test case builds for me on incoming.
Ah, the stage0 compiler does ICE. Maybe we just need to snapshot.
I started a snapshot.
That fixed it.