Skip to content

Internal compiler error #9122

Closed
Closed

Description

I'm running rust 0.7-1, the following program:

use std::hashmap::{HashMap, Map};


fn do_something<'input, M: Map<int, &'self str>> (key: int, map: &'input M){
    match map.find(key){
        Some(result) => println(fmt!("%s", result)),
        None => println("no match")
    };
}

fn main(){
    let  map : HashMap<int, &str> = HashMap::new();
    map.insert(1, "one");
    do_something(1, map);
}

Causes rustc to fail with the following message

rust: task failed at 'assertion failed: rp.is_none()', /build/rust/src/rust-0.7/src/librustc/middle/typeck/collect.rs:1040
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /build/rust/src/rust-0.7/src/librustc/rustc.rs:354
rust: domain main @0x1552d70 root task failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions