rust/src
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
..
bootstrap Rollup merge of #118738 - devnexen:netbsd10_update, r=cuviper 2024-02-14 11:53:38 +01:00
ci cargo update 2024-02-13 21:24:16 +00:00
doc Rollup merge of #121021 - GuillaumeGomez:extend-intra-doc-link-chapter, r=notriddle 2024-02-13 17:38:12 +01:00
etc Update tests. 2024-01-27 16:38:57 +01:00
librustdoc Rollup merge of #121022 - fmease:rustdoc-x-crate-late-bound-lt-src-order, r=GuillaumeGomez 2024-02-15 09:20:18 +01:00
llvm-project@9ea7f739f2 Update to LLVM 18 2024-02-13 10:33:40 +01:00
rustdoc-json-types Add is_object_safe information for traits in JSON output 2023-12-23 11:43:31 +01:00
tools Auto merge of #116564 - oli-obk:evaluated_static_in_metadata, r=RalfJung,cjgillot 2024-02-15 10:28:31 +00:00
README.md Remove stale reference to the test suite location 2023-01-13 11:49:06 +00:00
stage0.json Bump to newly branched stage0 compiler 2024-02-08 07:43:38 -05:00
version Bump to 1.78 2024-02-03 13:14:34 -05:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.