2023-04-20 09:37:15 -05:00
|
|
|
//@run-rustfix
|
2022-04-08 14:54:44 -05:00
|
|
|
|
2022-04-08 13:07:19 -05:00
|
|
|
fn main() {
|
2022-04-12 12:34:55 -05:00
|
|
|
println!("Testing non erroneous option_take_on_temporary");
|
|
|
|
let mut option = Some(1);
|
|
|
|
let _ = Box::new(move || option.take().unwrap());
|
|
|
|
|
|
|
|
println!("Testing non erroneous option_take_on_temporary");
|
|
|
|
let x = Some(3);
|
|
|
|
x.as_ref();
|
|
|
|
|
|
|
|
println!("Testing erroneous option_take_on_temporary");
|
2022-04-08 13:07:19 -05:00
|
|
|
let x = Some(3);
|
2022-04-09 11:35:18 -05:00
|
|
|
x.as_ref().take();
|
2022-04-08 13:07:19 -05:00
|
|
|
}
|