rust/tests/ui/drop
Dylan DPC 828caa80a9
Rollup merge of #110930 - b-naber:normalize-elaborate-drops, r=cjgillot
Don't expect normalization to succeed in elaborate_drops

Fixes https://github.com/rust-lang/rust/issues/110682

This was exposed through the changes in https://github.com/rust-lang/rust/pull/109247, which causes more things to be inlined. Inlining can happen before monomorphization, so we can't expect normalization to succeed. In the elaborate_drops analysis we currently have [this call](033aa092ab/compiler/rustc_mir_dataflow/src/elaborate_drops.rs (L278)) to `normalize_erasing_regions`, which ICEs when normalization fails. The types are used to infer [whether the type needs a drop](033aa092ab/compiler/rustc_mir_dataflow/src/elaborate_drops.rs (L374)), where `needs_drop` itself [uses `try_normalize_erasing_regions`](033aa092ab/compiler/rustc_middle/src/ty/util.rs (L1121)).

~[`instance_mir`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.instance_mir) isn't explicit about whether it expects the instances corresponding to the `InstanceDef`s to be monomorphized (though I think in all other contexts the function is used post-monomorphization), so the use of `instance_mir` in inlining doesn't necessarily seem wrong to me.~
2023-05-17 19:11:53 +05:30
..
auxiliary
drop_order.rs
drop-foreign-fundamental.rs
drop-foreign-fundamental.stderr
drop-if-let-binding.rs
drop-on-empty-block-exit.rs
drop-on-ret.rs
drop-struct-as-object.rs
drop-trait-enum.rs
drop-trait-generic.rs
drop-trait.rs
drop-uninhabited-enum.rs
drop-with-type-ascription-1.rs
drop-with-type-ascription-2.rs
dropck_legal_cycles.rs
dropck-eyepatch-extern-crate.rs
dropck-eyepatch-manuallydrop.rs
dropck-eyepatch-reorder.rs
dropck-eyepatch.rs
dynamic-drop-async.rs
dynamic-drop.rs
issue-979.rs
issue-2734.rs
issue-2735-2.rs
issue-2735-3.rs
issue-2735.rs
issue-10028.rs
issue-17718-const-destructors.rs
issue-21486.rs
issue-23338-ensure-param-drop-order.rs
issue-30018-nopanic.rs
issue-35546.rs
issue-48962.rs
issue-90752-raw-ptr-shenanigans.rs
issue-90752.rs
issue-100276.rs
issue-103107.rs
issue-110682.rs
no-drop-flag-size.rs
nondrop-cycle.rs
repeat-drop-2.rs
repeat-drop-2.stderr
repeat-drop.rs
terminate-in-initializer.rs
use_inline_dtor.rs