Skip to content

ICE: Cannot relate bound region #11016

Closed
Closed
@eholk

Description

@eholk

Trying to compile the following program generates an internal compiler error.

pub struct SubMatrixView<'r, M>;

trait SubMatrix<'r, Base> {
    fn submatrix(&'r self) -> SubMatrixView<'r, Base>;
}

fn sub<'r, T, M: SubMatrix<'r, M>>(M: &'r M)
    -> SubMatrixView<M>
{
    M.submatrix();
}

fn main() {
}

The error message is:

test.rs:10:4: 10:5 error: internal compiler error: Cannot relate bound region: ReLateBound(20, BrNamed(syntax::ast::DefId{crate: 0u32, node: 37u32}, r)) <= ReInfer(3)
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
test.rs:10     M.submatrix();
               ^
task 'rustc' failed at 'explicit failure', /home/eric/projects/mozilla/rust/src/libsyntax/diagnostic.rs:76
task '<main>' failed at 'explicit failure', /home/eric/projects/mozilla/rust/src/librustc/lib.rs:391

cc @nikomatsakis

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions