2 // Test that cleanups for the RHS of shortcircuiting operators work.
4 // pretty-expanded FIXME #23616
9 let args: Vec<String> = env::args().collect();
11 // Here, the rvalue `"signal".to_string()` requires cleanup. Older versions
12 // of the code had a problem that the cleanup scope for this
13 // expression was the end of the `if`, and as the `"signal".to_string()`
14 // expression was never evaluated, we wound up trying to clean
15 // uninitialized memory.
17 if args.len() >= 2 && args[1] == "signal" {
19 unsafe { *std::ptr::null_mut::<isize>() = 0; }