Skip to content

Internal compiler error: cannot relate bound region. #14182

Closed

Description

The following minimal program reproducing the bug (in which I'm doing something terribly wrong I guess(?)):

fn main() {
    let mut x: Vec< <'a> ||:'a> = Vec::new();
    x.push(|| {});
}

outputs the following error on when simply compiling on Windows 7 (64 bits, using the 32-bits binaries on the website to compile) with rustc minimal.rs:

minimal.rs:3:9: 3:14 error: internal compiler error: cannot relate bound region: ReLateBound(11, BrNamed(syntax::ast::DefId{krate: 0u32, node: 13u32}, a)) <= ReInfer(7)
minimal.rs:3    x.push(|| {});
                       ^~~~~
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', C:\bot\slave\nightly-win\build\src\libsyntax\diagnostic.rs:99

rustc -v output:

rustc 0.11-pre-nightly (ab369c4 2014-05-09 00:51:35 -0700)
host: i686-pc-mingw32

Activity

  1. tomjakubowski commented on Jul 14, 2014

    @tomjakubowski
    Contributor

    Hit this myself with:

    struct Foo {
        f: <'b> |&'b int|: 'b -> &'b int
    }
    
    pub fn main() {
        let foo = Foo {
            f: |x| x
        };
    }
  2. ghost added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Nov 19, 2014
  3. added 3 commits that reference this issue on Dec 12, 2014
    20cbbff
    c59b9b7
  4. added a commit that references this issue on Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions