blob: 0e297dd8ff16b9e1e7b8660eb48cac801ce13ca8 [file] [log] [blame]
// compile-flags: --edition 2018
#![feature(try_blocks)]
pub fn main() {
let res: Result<u32, i32> = try {
Err("")?; //~ ERROR the trait bound `i32: std::convert::From<&str>` is not satisfied
5
};
let res: Result<i32, i32> = try {
"" //~ ERROR type mismatch
};
let res: Result<i32, i32> = try { }; //~ ERROR type mismatch
let res: () = try { }; //~ the trait bound `(): std::ops::Try` is not satisfied
let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied
}