2023-04-20 14:37:15 +00:00
|
|
|
//@run-rustfix
|
2022-04-08 21:54:44 +02:00
|
|
|
|
2022-04-08 20:07:19 +02:00
|
|
|
fn main() {
|
2022-04-12 19:34:55 +02: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 20:07:19 +02:00
|
|
|
let x = Some(3);
|
2022-04-09 18:35:18 +02:00
|
|
|
x.as_ref().take();
|
2022-04-08 20:07:19 +02:00
|
|
|
}
|