rust/compiler
bors 6a4222b511 Auto merge of #116564 - oli-obk:evaluated_static_in_metadata, r=RalfJung,cjgillot
Store static initializers in metadata instead of the MIR of statics.

This means that adding generic statics would be even more difficult, as we can't evaluate statics from other crates anymore, but the subtle issue I have encountered make me think that having this be an explicit problem is better.

The issue is that

```rust
static mut FOO: &mut u32 = &mut 42;
static mut BAR = unsafe { FOO };
```

gets different allocations, instead of referring to the same one. This is also true for non-static mut, but promotion makes `static FOO: &u32 = &42;` annoying to demo.

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

## Why is this being done?

In order to ensure all crates see the same nested allocations (which is the last issue that needs fixing before we can stabilize [`const_mut_refs`](https://github.com/rust-lang/rust/issues/57349)), I am working on creating anonymous (from the Rust side, to LLVM it's like a regular static item) static items for the nested allocations in a static. If we evaluate the static item in a downstream crate again, we will end up duplicating its nested allocations (and in some cases, like the `match` case, even duplicate the main allocation).
2024-02-15 10:28:31 +00:00
..
rustc
rustc_abi Fix rustc_abi build on stable 2024-01-16 21:15:31 +01:00
rustc_arena Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_ast Pin memchr version 2024-02-13 21:03:34 +00:00
rustc_ast_lowering Reinstate some delayed bugs. 2024-02-15 09:26:45 +11:00
rustc_ast_passes Rollup merge of #120751 - estebank:issue-68982, r=nnethercote 2024-02-13 06:27:37 +01:00
rustc_ast_pretty Lower anonymous structs or unions to HIR 2024-02-12 12:47:23 +08:00
rustc_attr Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_baked_icu_data
rustc_borrowck Auto merge of #120454 - clubby789:cargo-update, r=Nilstrieb 2024-02-14 05:27:31 +00:00
rustc_builtin_macros Add #[derive(Clone, Copy)] to anonymous adts 2024-02-12 12:47:32 +08:00
rustc_codegen_cranelift Auto merge of #120843 - matthiaskrgr:rollup-med37z5, r=matthiaskrgr 2024-02-09 15:34:48 +00:00
rustc_codegen_gcc Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_codegen_llvm Rollup merge of #120965 - ChrisDenton:sahf, r=michaelwoerister 2024-02-12 23:18:54 +01:00
rustc_codegen_ssa Bump indexmap 2024-02-13 21:03:34 +00:00
rustc_const_eval Auto merge of #116564 - oli-obk:evaluated_static_in_metadata, r=RalfJung,cjgillot 2024-02-15 10:28:31 +00:00
rustc_data_structures Fix SmallCStr conversion from CStr 2024-02-14 18:40:53 -08:00
rustc_driver
rustc_driver_impl Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_error_codes Dejargnonize subst 2024-02-12 15:46:35 +09:00
rustc_error_messages Remove good_path_delayed_bug. 2024-02-13 09:33:35 +11:00
rustc_errors Rollup merge of #121015 - nnethercote:opt-delayed-bug, r=oli-obk 2024-02-14 11:53:40 +01:00
rustc_expand Use fewer delayed bugs. 2024-02-14 20:30:37 +11:00
rustc_feature Rollup merge of #120965 - ChrisDenton:sahf, r=michaelwoerister 2024-02-12 23:18:54 +01:00
rustc_fluent_macro Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_fs_util Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_graphviz Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_hir Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk 2024-02-12 23:18:54 +01:00
rustc_hir_analysis Auto merge of #120847 - oli-obk:track_errors9, r=compiler-errors 2024-02-14 18:32:19 +00:00
rustc_hir_pretty Lower anonymous structs or unions to HIR 2024-02-12 12:47:23 +08:00
rustc_hir_typeck Auto merge of #120847 - oli-obk:track_errors9, r=compiler-errors 2024-02-14 18:32:19 +00:00
rustc_incremental Make impl_trait_ref into a query also returning more information about the impl 2024-02-12 09:42:41 +00:00
rustc_index Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_index_macros Step all bootstrap cfgs forward 2024-02-08 07:44:34 -05:00
rustc_infer Use fewer delayed bugs. 2024-02-14 20:30:37 +11:00
rustc_interface Tweak delayed bug mentions. 2024-02-12 18:39:20 +11:00
rustc_lexer Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_lint Rollup merge of #121075 - chenyukang:yukang-fix-121070-lint-range, r=oli-obk 2024-02-14 15:41:28 +01:00
rustc_lint_defs Bump indexmap 2024-02-13 21:03:34 +00:00
rustc_llvm Pin cc version 2024-02-13 21:13:06 +00:00
rustc_log Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_macros Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwco 2024-02-09 14:41:50 +01:00
rustc_metadata Return ConstAllocation from eval_static_initializer query directly 2024-02-15 10:25:18 +00:00
rustc_middle Auto merge of #116564 - oli-obk:evaluated_static_in_metadata, r=RalfJung,cjgillot 2024-02-15 10:28:31 +00:00
rustc_mir_build Auto merge of #120847 - oli-obk:track_errors9, r=compiler-errors 2024-02-14 18:32:19 +00:00
rustc_mir_dataflow Rollup merge of #120802 - oli-obk:drop_elab_ice, r=compiler-errors 2024-02-13 06:27:38 +01:00
rustc_mir_transform Auto merge of #116564 - oli-obk:evaluated_static_in_metadata, r=RalfJung,cjgillot 2024-02-15 10:28:31 +00:00
rustc_monomorphize Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errors 2024-02-13 02:48:49 +00:00
rustc_next_trait_solver Move visitable bounds up into interner 2024-02-13 15:53:15 +00:00
rustc_parse Properly handle async blocks and fns in if exprs without else 2024-02-12 20:26:34 +00:00
rustc_parse_format Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_passes Bump indexmap 2024-02-13 21:03:34 +00:00
rustc_pattern_analysis Auto merge of #120991 - matthiaskrgr:rollup-f8kw2st, r=matthiaskrgr 2024-02-13 00:31:53 +00:00
rustc_privacy Dejargnonize subst 2024-02-12 15:46:35 +09:00
rustc_query_impl Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_query_system Use fewer delayed bugs. 2024-02-14 20:30:37 +11:00
rustc_resolve Rollup merge of #121084 - oli-obk:create_def_forever_red2, r=WaffleLapkin 2024-02-15 09:20:20 +01:00
rustc_serialize Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_session Remove good_path_delayed_bug. 2024-02-13 09:33:35 +11:00
rustc_smir Rollup merge of #120982 - momvart:smir-61-foreign_kind, r=oli-obk 2024-02-15 09:20:18 +01:00
rustc_span Rollup merge of #120965 - ChrisDenton:sahf, r=michaelwoerister 2024-02-12 23:18:54 +01:00
rustc_symbol_mangling Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obk 2024-02-12 23:18:54 +01:00
rustc_target Add lahfsahf and prfchw target feature 2024-02-12 10:31:12 -03:00
rustc_trait_selection Rollup merge of #121105 - compiler-errors:no-const-ty-overflow, r=oli-obk 2024-02-15 09:20:21 +01:00
rustc_traits Dejargnonize subst 2024-02-12 15:46:35 +09:00
rustc_transmute Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
rustc_ty_utils Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errors 2024-02-13 02:48:49 +00:00
rustc_type_ir Move visitable bounds up into interner 2024-02-13 15:53:15 +00:00
stable_mir Rollup merge of #120982 - momvart:smir-61-foreign_kind, r=oli-obk 2024-02-15 09:20:18 +01:00