rust/src
bors e82584a77d Auto merge of #75585 - RalfJung:demotion, r=oli-obk
Do not promote &mut of a non-ZST ever

Since ~pre-1.0~ 1.36, we have accepted code like this:
```rust
static mut TEST: &'static mut [i32] = {
    let x = &mut [1,2,3];
    x
};
```
I tracked it back to https://github.com/rust-lang/rust/pull/21744, but unfortunately could not find any discussion or RFC that would explain why we thought this was a good idea. And it's not, it breaks all sorts of things -- see https://github.com/rust-lang/rust/issues/75556.

To fix https://github.com/rust-lang/rust/issues/75556, we have to stop promoting non-ZST mutable references no matter the context, which is what this PR does. It's a breaking change.

Notice that this still works, since it does not rely on promotion:
```rust
static mut TEST: &'static mut [i32] = &mut [0,1,2];
```

Cc `@rust-lang/wg-const-eval`
2020-09-08 05:13:42 +00:00
..
bootstrap Auto merge of #76326 - mati865:use_lld-no-linker, r=Mark-Simulacrum 2020-09-06 04:00:56 +00:00
build_helper cleanup: Remove duplicate library names from Cargo.tomls 2020-08-30 22:57:54 +03:00
ci Enable profiler tests on Windows-gnu 2020-09-04 15:10:16 +02:00
doc Adjust documentation for slice_check_range 2020-09-05 19:53:35 -04:00
etc Fix loading pretty-printers in rust-lldb script 2020-08-28 09:29:45 +03:00
librustc_llvm Auto merge of #75655 - nielx:fix/haiku-llvm-libz, r=Mark-Simulacrum 2020-09-04 14:32:33 +00:00
librustdoc Rollup merge of #76082 - jyn514:top-level-links, r=ollie27,GuillaumeGomez 2020-09-05 16:28:28 +02:00
llvm-project@833dd1e3d4 Update llvm-project to include PR 73 2020-09-05 12:49:17 -07:00
rustllvm Write coverage filenames in Version3 format 2020-08-22 13:44:54 -07:00
test Auto merge of #75585 - RalfJung:demotion, r=oli-obk 2020-09-08 05:13:42 +00:00
tools Auto merge of #76044 - ecstatic-morse:dataflow-lattice, r=oli-obk 2020-09-07 21:29:43 +00:00
README.md Update README.md 2020-08-30 13:40:11 -05:00
stage0.txt bump version to 1.48 2020-08-26 10:16:59 +02:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

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