]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/option_take_on_temporary.fixed
New upstream version 1.62.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / option_take_on_temporary.fixed
1 // run-rustfix
2
3 fn main() {
4 println!("Testing non erroneous option_take_on_temporary");
5 let mut option = Some(1);
6 let _ = Box::new(move || option.take().unwrap());
7
8 println!("Testing non erroneous option_take_on_temporary");
9 let x = Some(3);
10 x.as_ref();
11
12 println!("Testing erroneous option_take_on_temporary");
13 let x = Some(3);
14 x.as_ref();
15 }