Files
rust/compiler
bors f1e691da2e Auto merge of #86138 - FabianWolff:issue-85871, r=nikomatsakis
Check whether the closure's owner is an ADT in thir-unsafeck

This pull request fixes #85871. The code in `rustc_mir_build/src/check_unsafety.rs` incorrectly assumes that a closure's owner always has a body, but only functions, closures, and constants have bodies, whereas a closure can also appear inside a struct or enum:
```rust
struct S {
    arr: [(); match || 1 { _ => 42 }]
}

enum E {
    A([(); { || 1; 42 }])
}
```
This pull request fixes the resulting ICE by checking whether the closure's owner is an ADT and only deferring to `thir_check_unsafety(owner)` if it isn't.
2021-06-23 21:35:46 +00:00
..
2021-04-04 14:10:26 -07:00
2021-03-27 22:16:33 -04:00
2021-05-24 11:07:48 -04:00
2021-06-04 13:20:05 +02:00
2021-03-27 22:16:33 -04:00
2021-05-31 13:55:43 +02:00
2021-05-24 11:07:48 -04:00
2021-05-31 13:55:43 +02:00