rust/tests/ui/borrowck/issue-11493.rs
2023-01-11 09:32:08 +00:00

9 lines
146 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;
}