rust/tests/ui/borrowck/issue-11493.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
173 B
Rust
Raw Normal View History

// 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;
}