]> git.lizzy.rs Git - rust.git/blob - src/test/ui/thir-unsafeck-issue-85871.rs
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[rust.git] / src / test / ui / thir-unsafeck-issue-85871.rs
1 // Tests that no ICE occurs when a closure appears inside a node
2 // that does not have a body when compiling with
3 // compile-flags: -Zthir-unsafeck=yes
4 // check-pass
5
6 #![allow(dead_code)]
7
8 struct Bug {
9     inner: [(); match || 1 {
10         _n => 42, // we may not call the closure here (E0015)
11     }],
12 }
13
14 enum E {
15     V([(); { let _ = || 1; 42 }]),
16 }
17
18 type Ty = [(); { let _ = || 1; 42 }];
19
20 fn main() {}