rust/compiler/rustc_middle/src
Tomasz Miąsko 915a581bcb 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.
2021-10-18 21:56:57 +02:00
..
dep_graph Query the fingerprint style during key reconstruction 2021-10-06 22:19:48 -04:00
hir rustc_span: Ident::invalid -> Ident::empty 2021-10-17 23:20:30 +03:00
infer Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
middle Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoerister 2021-10-07 20:26:11 -07:00
mir Do not promote values with const drop that need to be dropped 2021-10-18 21:56:57 +02:00
query Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnr 2021-10-17 12:33:12 +00:00
thir add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
traits Fix spelling: Cannonical -> Canonical 2021-10-10 00:44:34 -04:00
ty Rollup merge of #89946 - JohnTitor:fix-89686, r=petrochenkov 2021-10-17 18:18:58 +02:00
util Make panic/assert calls in rustc compatible with Rust 2021. 2021-02-03 22:42:53 +01:00
arena.rs Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
lib.rs Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
lint.rs Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister 2021-10-05 09:45:11 +00:00
macros.rs Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00