about summary refs log tree commit diff
path: root/tests/ui/type/option-ref-advice.rs
blob: 435b15d01e3c3ce4698dc5e909e581e4fb5a4b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Regression test for https://github.com/rust-lang/rust/issues/100605

fn takes_option(_arg: Option<&String>) {}

fn main() {
    takes_option(&None); //~ ERROR mismatched types [E0308]

    let x = String::from("x");
    let res = Some(x);
    takes_option(&res); //~ ERROR mismatched types [E0308]
}