Region parameter out of range when substituting in region 'a


Playground link


trait Foo {
    type Bar;
    fn foo<'a>(&'a mut self) -> Self::Bar where Self::Bar: 'a;

struct FooA{}
struct Bar<'a> {
    foo: &'a mut FooA
impl Foo for FooA
    type Bar<'a> = Bar<'a>;
    fn foo<'a>(&'a mut self) -> Bar<'a> {
        Bar{foo: self}

fn main() {


   Compiling playground v0.0.1 (file:///playground)
error: internal compiler error: librustc/ty/ Region parameter out of range when substituting in region 'a (root type=Some(Bar<'a>)) (index=0)

thread 'main' panicked at 'Box<Any>', librustc_errors/
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report:

note: rustc 1.28.0-nightly (967c1f3be 2018-06-15) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.


This superficially looks like though some details of the MCE differ. Best to just create an issue if you’re unsure; ICEs are high-profile and nobody will be bothered by a duplicate issue.



For other ICEs, yes, they should be counted as long as they exists. But for this, no. I have learned from the relevent issues that this feature is currently not in a useable status, so maybe just wait and see if this fixed in another day. There are already a couple issues have been raised regarding this.

1 Like

closed #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.