diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-19 05:40:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-19 05:40:54 +0200 |
| commit | a0724d72b0419a4e458c0174af27c85817b1f7ba (patch) | |
| tree | 82dfc0b15353ca077f8def846b0f5c3afcc27136 /compiler/rustc_mir_transform/src/coverage/counters.rs | |
| parent | 8c8835d277e2b462ebf0584b4eb2db93369603a6 (diff) | |
| parent | 915a581bcb3d9b7e1e2ef0da4fbfbae6b1a7fa7f (diff) | |
| download | rust-a0724d72b0419a4e458c0174af27c85817b1f7ba.tar.gz rust-a0724d72b0419a4e458c0174af27c85817b1f7ba.zip | |
Rollup merge of #89988 - tmiasko:unpromote-const-drop, r=oli-obk
Do not promote values with const drop that need to be dropped
Changes from #88558 allowed using `~const Drop` in constants by
introducing a new `NeedsNonConstDrop` qualif.
The new qualif was also used for promotion purposes, and allowed
promotion to happen for values that needs to be dropped but which
do have a const drop impl.
Since for promoted the drop implementation is never executed,
this lead to observable change in behaviour. For example:
```rust
struct Panic();
impl const Drop for Panic {
fn drop(&mut self) {
panic!();
}
}
fn main() {
let _ = &Panic();
}
```
Restore the use of `NeedsDrop` qualif during promotion to avoid the issue.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/counters.rs')
0 files changed, 0 insertions, 0 deletions
