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