1 // compile-flags: --edition 2018
3 #![feature(try_blocks)]
6 let res: Result<u32, std::array::TryFromSliceError> = try {
7 Err("")?; //~ ERROR `?` couldn't convert the error
11 let res: Result<i32, i32> = try {
12 "" //~ ERROR type mismatch
15 let res: Result<i32, i32> = try { }; //~ ERROR type mismatch
17 let res: () = try { };
18 //~^ ERROR the trait bound `(): Try` is not satisfied
19 //~| ERROR the trait bound `(): Try` is not satisfied
21 let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: Try` is not satisfied