]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-11493.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / borrowck / issue-11493.rs
1 // run-rustfix
2 fn id<T>(x: T) -> T { x }
3
4 fn main() {
5     let x = Some(3);
6     let y = x.as_ref().unwrap_or(&id(5));  //~ ERROR
7     let _ = &y;
8 }