-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
Was working on trying to inherit from a trait with a <'self>
lifetime parameter, like so:
trait A<'self> { fn foo(&self) -> &'self str; } trait B : A { fn bar(&self); }
and was getting this compile error:
error: Illegal anonymous lifetime: anonymous lifetimes are not permitted here
trait A<'self> { fn foo(&self) -> &'self str; } trait B : A { fn bar(&self); }
^~
aborting due to previous error
So I thought maybe I could just annotate the inherited trait with the lifetime:
trait A<'self> { fn foo(&self) -> &'self str; } trait B<'self> : A<'self> { fn bar(&self); }
which produced this ice:
task <unnamed> failed at 'region parameterization should have inferred that this type is RP', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/librustc/middle/typeck/rscope.rs:238
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
task <unnamed> failed at 'explicit failure', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/librustc/rustc.rs:371
make: *** [x86_64-unknown-linux-gnu/stage0/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd.so] Error 101
AFAICT, it's putting <'self>
on A
when declaring B
is what's causing the ICE.
Metadata
Metadata
Assignees
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️