Skip to content

Internal compiler error #9122

@alexjg

Description

@alexjg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions