Skip to content

ICE: Cannot relate bound region #11016

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
eholk opened this issue Dec 17, 2013 · 2 comments
Closed

ICE: Cannot relate bound region #11016

eholk opened this issue Dec 17, 2013 · 2 comments
Labels
A-lifetimes Area: Lifetimes / regions

Comments

@eholk
Copy link
Contributor

eholk commented Dec 17, 2013

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

@nikomatsakis
Copy link
Contributor

Dup of #5121

@pnkfelix
Copy link
Member

(this example continues to reproduce, as is, atop rustc 0.10-pre (caf17fe 2014-03-21)

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 14, 2023
[`filter_next`]: suggest making binding mutable if it needs to be

Fixes rust-lang#10029

changelog: [`filter_next`]: suggest making binding mutable if it needs to be and adjust applicability
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lifetimes Area: Lifetimes / regions
Projects
None yet
Development

No branches or pull requests

3 participants