rust/tests
bors 730d5d4095 Auto merge of #128572 - compiler-errors:fix-elaborate-box-derefs-on-debug, r=saethlin
Fix `ElaborateBoxDerefs` on debug varinfo

Slightly simplifies the `ElaborateBoxDerefs` pass to fix cases where it was applying the wrong projections to debug var infos containing places that deref boxes.

From what I can tell[^1], we don't actually have any tests (or code anywhere, really) that exercise `debug x => *(...: Box<T>)`, and it's very difficult to trigger this in surface Rust, so I wrote a custom MIR test.

What happens is that the pass was turning `*(SOME_PLACE: Box<T>)` into `*(*((((SOME_PLACE).0: Unique<T>).0: NonNull<T>).0: *const T))` in debug var infos. In particular, notice the *double deref*, which was wrong.

This is the root cause of #128554, so this PR fixes #128554 as well. The reason that async closures was affected is because of the way that we compute the [`ByMove` body](https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/coroutine/by_move_body.rs), which resulted in `*(...: Box<T>)` in debug var info. But this really has nothing to do with async closures.

[^1]: Validated by literally replacing the `if elem == PlaceElem::Deref && base_ty.is_box() { ... }` innards with a `panic!()`, which compiled all of stage2 without panicking.
2024-08-10 21:24:25 +00:00
..
assembly Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
auxiliary
codegen Auto merge of #128584 - DianQK:tests-for-llvm-19, r=nikic 2024-08-10 01:59:54 +00:00
codegen-units Revert "Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix" 2024-08-03 07:57:31 -04:00
coverage Finish blessing coverage/mcdc tests after LLVM 19 upgrade 2024-08-01 13:36:50 +10:00
coverage-run-rustdoc
crashes Auto merge of #128714 - camelid:wf-struct-exprs, r=BoxyUwU 2024-08-10 05:27:17 +00:00
debuginfo Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
incremental Do not normalize constants eagerly. 2024-07-31 00:59:12 +00:00
mir-opt Auto merge of #128572 - compiler-errors:fix-elaborate-box-derefs-on-debug, r=saethlin 2024-08-10 21:24:25 +00:00
pretty
run-make Rollup merge of #128909 - saethlin:run-make-ice-yes, r=jieyouxu 2024-08-10 16:23:54 +02:00
run-pass-valgrind
rustdoc Add regression tests for negative impls not showing their items 2024-08-10 15:03:43 +02:00
rustdoc-gui rustdoc-search: account for numeric disambiguators on impls 2024-08-06 07:36:12 -07:00
rustdoc-js Add test for Self not being a generic in search index 2024-08-04 12:49:28 -07:00
rustdoc-js-std
rustdoc-json Rollup merge of #128836 - its-the-shrimp:add_test_for_107278, r=aDotInTheVoid 2024-08-09 00:03:38 +02:00
rustdoc-ui rustdoc: move invalid langstring test to UI 2024-08-09 07:57:46 -07:00
ui Auto merge of #128572 - compiler-errors:fix-elaborate-box-derefs-on-debug, r=saethlin 2024-08-10 21:24:25 +00:00
ui-fulldeps Bless test fallout 2024-08-03 07:57:31 -04:00
COMPILER_TESTS.md