2018-07-21 22:59:44 -05:00
|
|
|
// compile-flags: --edition 2018
|
|
|
|
|
2018-07-24 20:03:25 -05:00
|
|
|
#![feature(try_blocks)]
|
2017-02-28 13:05:03 -06:00
|
|
|
|
2017-03-14 18:48:01 -05:00
|
|
|
fn use_val<T: Sized>(_x: T) {}
|
|
|
|
|
2017-02-28 13:05:03 -06:00
|
|
|
pub fn main() {
|
|
|
|
let cfg_res;
|
2018-07-21 22:59:44 -05:00
|
|
|
let _: Result<(), ()> = try {
|
2017-02-28 13:05:03 -06:00
|
|
|
Err(())?;
|
|
|
|
cfg_res = 5;
|
2017-03-14 18:48:01 -05:00
|
|
|
Ok::<(), ()>(())?;
|
|
|
|
use_val(cfg_res);
|
2017-02-28 13:05:03 -06:00
|
|
|
};
|
2022-06-21 13:57:45 -05:00
|
|
|
assert_eq!(cfg_res, 5); //~ ERROR E0381
|
2017-02-28 13:05:03 -06:00
|
|
|
}
|