about summary refs log tree commit diff
path: root/tests/ui/issues/issue-15783.rs
blob: ef948a1a88ce11eb216d522c396543ff9b32e833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ dont-require-annotations: NOTE

pub fn foo(params: Option<&[&str]>) -> usize {
    params.unwrap().first().unwrap().len()
}

fn main() {
    let name = "Foo";
    let x = Some(&[name]);
    let msg = foo(x);
    //~^ ERROR mismatched types
    //~| NOTE expected enum `Option<&[&str]>`
    //~| NOTE found enum `Option<&[&str; 1]>`
    //~| NOTE expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
    assert_eq!(msg, 3);
}