Skip to content

ICE "no enclosing scope" with cross-crate map #5521

Closed
@alexcrichton

Description

@alexcrichton

Given these two files:

// foo.rs
#[link(name="foo",vers="0.0")];
#[crate_type = "lib"];
use std::hashmap::HashMap;

pub type map = @mut HashMap<uint, uint>;

// end of foo.rs
// bar.rs
extern mod foo;

fn foo(a: foo::map) {
    if false {
        fail!();
    } else {
        let _b = a.get(&2); // error may for this line; doesn't happen if "let _b" is omitted
    }
}

fn main() {}

// end of bar.rs

Yield this result:

$ rustc foo.rs && rustc -L . bar.rs
warning: no debug symbols in executable (-arch x86_64)
error: internal compiler error: no enclosing scope with id 18

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions