summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/issue-11493.fixed
blob: 139bd9a073973fdcc30117ea11c2be0f202fbb43 (plain)
1
2
3
4
5
6
7
8
9
// run-rustfix
fn id<T>(x: T) -> T { x }

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