rust/tests
Matthias Krüger 5afb4c2b21
Rollup merge of #127068 - compiler-errors:stall-drop, r=BoxyUwU
Stall computing instance for drop shim until it has no unsubstituted const params

Do not inline the drop shim for types that still have unsubstituted const params.

## Why?

#127030 ICEs because it tries to inline the drop shim for a type with an unsubstituted const param. In order to generate this shim, this requires calling the drop shim builder, which invokes the trait solver to compute whether constituent types need drop (since we compute if a type is copy to disqualify any `Drop` behavior):

9c3bc805dd/compiler/rustc_mir_dataflow/src/elaborate_drops.rs (L378)

However, since we don't keep the param-env of the instance we resolved the item for, we use the wrong param-env:
9c3bc805dd/compiler/rustc_mir_transform/src/shim.rs (L278)
(which is the param-env of `std::ptr::drop_in_place`)

This param-env is notably missing `ConstParamHasTy` predicates, and since we removed the type from consts in https://github.com/rust-lang/rust/pull/125958, we literally cannot prove these predicates in this (relatively) empty param-env. This currently happens in places like the MIR inliner, but may happen elsewhere such as in lints that resolve terminators.

## What?

We force the inliner to not consider calls for `drop_in_place` for types that have unsubstituted const params.

## So what?

This may negatively affect MIR inlining, but I doubt this matters in practice, and fixes a beta regression, so let's fix it. I will look into approaches for fixing this in a more maintainable way, perhaps delaying the creation of drop shim bodies until codegen (like how intrinsics work).
2024-06-28 22:04:18 +02:00
..
assembly Rollup merge of #126555 - beetrees:f16-inline-asm-arm, r=Amanieu 2024-06-22 12:57:18 +02:00
auxiliary
codegen Updated code for changes to RFC, added additional error handling, added 2024-06-25 19:00:02 +02:00
codegen-units Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
coverage Rollup merge of #126956 - joboet:fmt_no_extern_ty, r=RalfJung 2024-06-28 08:34:08 +02:00
coverage-run-rustdoc
crashes Do not ICE when suggesting dereferencing closure arg 2024-06-24 03:39:54 +00:00
debuginfo Add debuginfo tests for collapse_debuginfo for statics. 2024-06-13 16:04:31 +02:00
incremental Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoerister 2024-06-20 09:06:16 +00:00
mir-opt Auto merge of #126844 - scottmcm:more-ptr-cast-gvn, r=saethlin 2024-06-26 14:22:31 +00:00
pretty Auto merge of #125918 - oli-obk:const_block_ice, r=compiler-errors 2024-06-07 09:08:59 +00:00
run-make Auto merge of #127000 - Oneirical:no-test-for-the-wicked, r=Kobzol 2024-06-28 17:42:05 +00:00
run-pass-valgrind rustfmt tests/run-pass-valgrind/. 2024-06-04 09:53:02 +10:00
rustdoc Update tests/rustdoc to new test syntax 2024-06-24 11:08:41 +02:00
rustdoc-gui Update browser-ui-test version to 0.18.0 2024-06-27 00:04:23 +02:00
rustdoc-js rustdoc-search: use lowercase, non-normalized name for type search 2024-06-09 11:56:52 -07:00
rustdoc-js-std Update tests 2024-06-07 11:55:52 +08:00
rustdoc-json rustfmt tests/rustdoc-json/. 2024-06-04 14:15:19 +10:00
rustdoc-ui Rollup merge of #127016 - bvanjoi:fix-126986, r=GuillaumeGomez 2024-06-28 22:04:16 +02:00
ui Rollup merge of #127068 - compiler-errors:stall-drop, r=BoxyUwU 2024-06-28 22:04:18 +02:00
ui-fulldeps Add method to get all attributes on a definition 2024-06-28 13:24:41 +08:00
COMPILER_TESTS.md