]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-return-type-mismatch.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / ui / closures / closure-return-type-mismatch.rs
1 fn main() {
2     || {
3         if false {
4             return "test";
5         }
6         let a = true;
7         a //~ ERROR mismatched types
8     };
9
10     || -> bool {
11         if false {
12             return "hello" //~ ERROR mismatched types
13         };
14         let b = true;
15         b
16     };
17 }