diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-02 15:52:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-02 15:52:00 +0100 |
| commit | 0666a33a6b8d39112f77cff65b6742092cfa736a (patch) | |
| tree | b3a16008d55866bffbea5f99886f504e4fb6a84e /compiler/rustc_mir_transform/src/coverage/mod.rs | |
| parent | d9baa361902b172be716f96619b909f340802dea (diff) | |
| parent | f7ef1c9f4163df30ae67ab177d5c306cb90b3d47 (diff) | |
| download | rust-0666a33a6b8d39112f77cff65b6742092cfa736a.tar.gz rust-0666a33a6b8d39112f77cff65b6742092cfa736a.zip | |
Rollup merge of #89234 - nbdd0121:discr, r=jackh726
Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant
Code like
```rust
#[repr(u8)]
enum Enum {
Foo /* = 0 */,
Bar(),
Baz{}
}
let x = Enum::Bar() as u8;
```
seems to be unintentionally allowed so we couldn't disallow them now ~~, but we could disallow them if arbitrary enum discriminant is used before 1.56 hits stable~~ (stabilization was reverted).
Related: #88621
`@rustbot` label +T-lang
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions
