mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
10 lines
173 B
Rust
10 lines
173 B
Rust
// 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;
|
|
}
|