blob: ef10b47fd1305343e32ba8100bb4bbf09f0eb81d [file] [log] [blame]
// compile-flags: --edition 2018
#![feature(try_blocks)]
fn use_val<T: Sized>(_x: T) {}
pub fn main() {
let cfg_res;
let _: Result<(), ()> = try {
Err(())?;
cfg_res = 5;
Ok::<(), ()>(())?;
use_val(cfg_res);
};
assert_eq!(cfg_res, 5); //~ ERROR borrow of possibly-uninitialized variable: `cfg_res`
}