• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // edition:2021
2 
3 #![feature(inline_const)]
4 
closure()5 fn closure() {
6     loop {
7         let closure = || {
8             if true {
9                 Err(1)
10                 //~^ ERROR mismatched types
11             }
12 
13             Ok(())
14         };
15     }
16 }
17 
async_block()18 fn async_block() {
19     loop {
20         let fut = async {
21             if true {
22                 Err(1)
23                 //~^ ERROR mismatched types
24             }
25 
26             Ok(())
27         };
28     }
29 }
30 
fn_item()31 fn fn_item() {
32     let _ = loop {
33         fn foo() -> Result<(), ()> {
34             if true {
35                 Err(1)
36                 //~^ ERROR mismatched types
37             }
38             Err(())
39         }
40     };
41 }
42 
const_block()43 fn const_block() {
44     let _ = loop {
45         const {
46             if true {
47                 Err(1)
48                 //~^ ERROR mismatched types
49             }
50             Err(())
51         };
52     };
53 }
54 
main()55 fn main() {}
56