summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/issue-11493.rs
blob: cb77f89fb2b1ec5efe544d5f45db1fc7c12b6da8 (plain)
1
2
3
4
5
6
7
8
// run-rustfix
fn id<T>(x: T) -> T { x }

fn main() {
    let x = Some(3);
    let y = x.as_ref().unwrap_or(&id(5));  //~ ERROR
    let _ = &y;
}