mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
9 lines
147 B
Rust
9 lines
147 B
Rust
//@ 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;
|
|
}
|