Closed
Description
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