Closed crumblingstatue closed 10 years ago
Duplicate? https://github.com/rust-lang/rust/issues/16596
This code and the code in that issue gives no ICE on 0.11.0
The given example no longer causes an ICE on master. http://is.gd/n0Ovjs Output:
<anon>:5:1: 7:2 error: the parameter type `T` may not live long enough; consider adding an explicit lifetime bound `T:'a`...
<anon>:5 struct List<'a, T: ListItem<'a>> {
<anon>:6 slice: &'a [T],
<anon>:7 }
<anon>:5:1: 7:2 note: ...so that the reference type `&'a [T]` does not outlive the data it points at
<anon>:5 struct List<'a, T: ListItem<'a>> {
<anon>:6 slice: &'a [T],
<anon>:7 }
error: aborting due to previous error
However, following the prescribed advice of the compiler does seem to reproduce the ICE. http://is.gd/PKO0dk Output:
<anon>:9:1: 13:2 error: internal compiler error: cannot relate bound region: ReEarlyBound(31, TypeSpace, 0, 'a) <= ReFree(26, BrNamed(syntax::ast::DefId{krate: 0u32, node: 31u32}, 'a))
<anon>:9 impl<'a, T: 'a + ListItem<'a>> Collection for List<'a, T> {
<anon>:10 fn len(&self) -> uint {
<anon>:11 0
<anon>:12 }
<anon>:13 }
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /build/rust-git/src/rust/src/libsyntax/ast_util.rs:784
This code
Causes this ICE
RUSTC_BACKTRACE=1 output
rustc -v:
rustc 0.12.0-pre-nightly (833277e2d 2014-08-25 00:00:59 +0000)
uname -a:Linux 3.16.1-1-ARCH #1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014 x86_64 GNU/Linux