Skip to content

ICE when pattern matching on &[T] #12567

Closed
@tikue

Description

@tikue

merge.rs:

fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
    match (l1, l2) {
        ([], []) => println!("both empty"),
        ([], [hd, ..tl]) | ([hd, ..tl], []) => println!("one empty"),
        ([hd1, ..tl1], [hd2, ..tl2]) => println!("both nonempty"),
    }
}

fn main() {}
$ rustc merge.rs
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
Ok(task 'rustc' failed at 'called `Option::unwrap()` on a `None` value', /Users/tkuehn/rust/src/libstd/option.rs:149
)

This is as minimal an example as I've been able to create that exhibits this ICE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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