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
147 B
Rust
Raw Normal View History

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