rust/compiler/rustc_codegen_ssa/src
bors 3b85d2c7fc Auto merge of #121644 - oli-obk:unique_static_innards2, r=RalfJung,nnethercote
Ensure nested allocations in statics neither get deduplicated nor duplicated

This PR generates new `DefId`s for nested allocations in static items and feeds all the right queries to make the compiler believe these are regular `static` items. I chose this design, because all other designs are fragile and make the compiler horribly complex for such a niche use case.

At present this wrecks incremental compilation performance *in case nested allocations exist* (because any query creating a `DefId` will be recomputed and never loaded from the cache). This will be resolved later in https://github.com/rust-lang/rust/pull/115613 . All other statics are unaffected by this change and will not have performance regressions (heh, famous last words)

This PR contains various smaller refactorings that can be pulled out into separate PRs. It is best reviewed commit-by-commit. The last commit is where the actual magic happens.

r? `@RalfJung` on the const interner and engine changes

fixes https://github.com/rust-lang/rust/issues/79738
2024-03-12 10:29:15 +00:00
..
back Change DefKind::Static to a struct variant 2024-03-12 05:53:46 +00:00
debuginfo Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
mir Auto merge of #121282 - saethlin:gep-null-means-no-provenance, r=scottmcm 2024-03-12 04:11:37 +00:00
traits Check whether a static is mutable instead of passing it down 2024-03-12 05:53:46 +00:00
assert_module_sources.rs Rename IntoDiagnosticArg as IntoDiagArg. 2024-03-11 09:12:19 +11:00
base.rs use ptradd for vtable indexing 2024-03-10 22:47:30 -04:00
codegen_attrs.rs Fix misleading message when using a named constant as a struct alignment/pack 2024-03-02 23:15:39 +08:00
common.rs move ConstValue into mir 2023-09-19 11:11:02 +02:00
errors.rs Rename IntoDiagnostic as Diagnostic. 2024-03-11 09:15:09 +11:00
lib.rs clean up potential_query_instability with FxIndexMap and UnordMap 2024-02-14 18:36:37 +08:00
meth.rs use ptradd for vtable indexing 2024-03-10 22:47:30 -04:00
mono_item.rs Check whether a static is mutable instead of passing it down 2024-03-12 05:53:46 +00:00
size_of_val.rs fix computing the dynamic alignment of packed structs with dyn trait tails 2023-12-13 20:21:57 +01:00
target_features.rs Bump indexmap 2024-02-13 21:03:34 +00:00