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

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

9 lines
146 B
Rust
Raw Normal View History

// run-rustfix
2017-08-13 11:46:49 +03:00
fn id<T>(x: T) -> T { x }
2014-05-06 22:53:02 -07:00
fn main() {
2015-01-31 17:23:42 +01:00
let x = Some(3);
let y = x.as_ref().unwrap_or(&id(5)); //~ ERROR
let _ = &y;
}