os-rust/compiler
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
..
rustc The rustc crate feature is called jemalloc 2024-07-15 13:01:20 -04:00
rustc_abi interpret: simplify pointer arithmetic logic 2024-08-01 14:25:19 +02:00
rustc_arena Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_ast Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_ast_ir Use dep: for crate dependencies 2024-07-15 12:40:10 -04:00
rustc_ast_lowering minor effects cleanups 2024-07-31 03:29:10 +00:00
rustc_ast_passes Rollup merge of #127921 - spastorino:stabilize-unsafe-extern-blocks, r=compiler-errors 2024-08-03 20:51:51 +02:00
rustc_ast_pretty Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_attr Rollup merge of #128341 - Alexendoo:parse-version-pub, r=compiler-errors 2024-07-29 17:46:44 +02:00
rustc_baked_icu_data Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_borrowck use stable sort to sort multipart diagnostics 2024-08-09 09:45:01 +02:00
rustc_builtin_macros Make Span optional in BufferedEarlyLint 2024-08-07 14:08:34 +02:00
rustc_codegen_cranelift Fixes in various places 2024-08-10 12:08:46 +02:00
rustc_codegen_gcc Fixes in various places 2024-08-10 12:08:46 +02:00
rustc_codegen_llvm Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen 2024-08-08 12:15:16 -04:00
rustc_codegen_ssa Auto merge of #128400 - petrochenkov:nowhole3, r=bjorn3 2024-08-10 18:57:58 +00:00
rustc_const_eval Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen 2024-08-08 12:15:16 -04:00
rustc_data_structures Tweak wording 2024-08-08 21:51:50 +02:00
rustc_driver Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_driver_impl Add -Zerror-metrics=PATH to save diagnostic metadata to disk 2024-08-07 11:16:55 -07:00
rustc_error_codes Update E0517 message to reflect RFC 2195. 2024-08-07 23:11:30 -05:00
rustc_error_messages Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_errors Update std and compiler 2024-08-10 12:07:17 +02:00
rustc_expand refactor(rustc_expand::mbe): Don't require full ExtCtxt when not necessary 2024-08-07 21:58:05 +02:00
rustc_feature Stabilize min_exhaustive_patterns 2024-08-10 12:07:17 +02:00
rustc_fluent_macro Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_fs_util Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_graphviz Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_hir Rollup merge of #128377 - veera-sivarajan:fix-128249, r=davidtwco 2024-08-06 20:23:39 +02:00
rustc_hir_analysis Rollup merge of #128910 - estebank:assoc-fn, r=compiler-errors 2024-08-10 16:23:55 +02:00
rustc_hir_pretty Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_hir_typeck Auto merge of #128714 - camelid:wf-struct-exprs, r=BoxyUwU 2024-08-10 05:27:17 +00:00
rustc_incremental Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_index Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_index_macros Remove usage of specialization from newtype_index! 2024-06-30 16:42:53 +00:00
rustc_infer Use Vec in instantiate_binder_with_fresh_vars 2024-07-29 14:38:33 +03:00
rustc_interface Rollup merge of #128851 - compiler-errors:validate-mir-opt-mir, r=matthiaskrgr 2024-08-09 00:03:39 +02:00
rustc_lexer Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_lint diagnostics: do not warn when a lifetime bound infers itself 2024-08-09 16:16:16 -07:00
rustc_lint_defs Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
rustc_llvm Enable zstd for debug compression. 2024-08-09 05:55:23 -07:00
rustc_log Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_macros Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_metadata Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_middle Auto merge of #128927 - GuillaumeGomez:rollup-ei2lr0f, r=GuillaumeGomez 2024-08-10 15:13:38 +00:00
rustc_mir_build Stabilize min_exhaustive_patterns 2024-08-10 12:07:17 +02:00
rustc_mir_dataflow Stop using MoveDataParamEnv for places that don't need a param-env 2024-07-29 11:59:47 -04:00
rustc_mir_transform Auto merge of #128572 - compiler-errors:fix-elaborate-box-derefs-on-debug, r=saethlin 2024-08-10 21:24:25 +00:00
rustc_monomorphize Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen 2024-08-08 12:15:16 -04:00
rustc_next_trait_solver Don't implement AsyncFn for FnDef/FnPtr that wouldnt implement Fn 2024-08-08 14:07:31 -04:00
rustc_parse parser: ensure let stmt compound assignment removal suggestion respect codepoint boundaries 2024-08-09 05:56:50 +00:00
rustc_parse_format Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_passes Rollup merge of #128552 - s7tya:check-no-sanitize-attribute-pos, r=BoxyUwU 2024-08-07 20:49:02 -05:00
rustc_pattern_analysis Stabilize min_exhaustive_patterns 2024-08-10 12:07:17 +02:00
rustc_privacy Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_query_impl Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_query_system chore: use shorthand initializer 2024-08-02 13:22:28 -04:00
rustc_resolve rm declared_features field in resolver 2024-08-08 20:30:20 +08:00
rustc_sanitizers Use ParamEnv::reveal_all in CFI 2024-08-02 23:24:50 -04:00
rustc_serialize Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_session Rollup merge of #128806 - estebank:color-config, r=jieyouxu 2024-08-09 00:03:36 +02:00
rustc_smir Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_span Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu 2024-08-07 00:34:11 +02:00
rustc_symbol_mangling Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_target Update std and compiler 2024-08-10 12:07:17 +02:00
rustc_trait_selection Auto merge of #128746 - compiler-errors:cache-super-outlives, r=lcnr 2024-08-10 10:22:06 +00:00
rustc_traits Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_transmute Update std and compiler 2024-08-10 12:07:17 +02:00
rustc_ty_utils Rename struct_tail_erasing_lifetimes to struct_tail_for_codegen 2024-08-08 12:15:16 -04:00
rustc_type_ir Update std and compiler 2024-08-10 12:07:17 +02:00
rustc_type_ir_macros Reformat use declarations. 2024-07-29 08:26:52 +10:00
stable_mir Reformat use declarations. 2024-07-29 08:26:52 +10:00