2018-07-21 22:59:44 -05:00
|
|
|
// compile-flags: --edition 2015
|
2018-04-03 02:04:23 -05:00
|
|
|
|
2018-07-21 22:59:44 -05:00
|
|
|
pub fn main() {
|
|
|
|
let try_result: Option<_> = try {
|
|
|
|
//~^ ERROR expected struct, variant or union type, found macro `try`
|
|
|
|
let x = 5; //~ ERROR expected identifier, found keyword
|
|
|
|
x
|
2018-04-03 02:04:23 -05:00
|
|
|
};
|
2018-07-21 22:59:44 -05:00
|
|
|
assert_eq!(try_result, Some(5));
|
2018-04-03 02:04:23 -05:00
|
|
|
}
|