rust/src
bors 7b3cd075bb Auto merge of #90788 - ecstatic-morse:issue-90752, r=wesleywiser
Mark places as initialized when mutably borrowed

Fixes the example in #90752, but does not handle some corner cases involving raw pointers and unsafe. See [this comment](https://github.com/rust-lang/rust/issues/90752#issuecomment-965822895) for more information, or the second test.

Although I talked about both `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` in #90752, this PR only changes the latter. That's because "maybe uninitialized" is the conservative choice, and marking them as definitely initialized (`!maybe_uninitialized`) when a mutable borrow is created could lead to problems if `addr_of_mut` to an uninitialized local is allowed. Additionally, places cannot become uninitialized via a mutable reference, so if a place is definitely initialized, taking a mutable reference to it should not change that.

I think it's correct to ignore interior mutability as nbdd0121 suggests below. Their analysis doesn't work inside of `core::cell`, which *does* have access to `UnsafeCell`'s field, but that won't be an issue unless we explicitly instantiate one with an `enum` within that module.

r? `@wesleywiser`
2021-11-23 17:44:33 +00:00
..
bootstrap Rollup merge of #90800 - aplanas:fix_cargo_config, r=Mark-Simulacrum 2021-11-19 13:06:35 +09:00
build_helper Migrate to 2021 2021-09-20 22:21:42 -04:00
ci Rollup merge of #90733 - wesleywiser:musl_debuginfo, r=Mark-Simulacrum 2021-11-16 23:58:21 +01:00
doc Update books 2021-11-22 13:39:44 -08:00
etc Encode json files with UTF-8 2021-09-30 00:11:14 +09:00
librustdoc Auto merge of #91094 - inquisitivecrystal:rustdoc-top-mod, r=jyn514 2021-11-23 03:13:26 +00:00
llvm-project@f9b03d0e2d Update llvm submodule 2021-11-16 16:49:16 +00:00
rustdoc-json-types Moved format-version constant to rustdoc-json-types 2021-10-15 12:27:42 +03:00
test Auto merge of #90788 - ecstatic-morse:issue-90752, r=wesleywiser 2021-11-23 17:44:33 +00:00
tools Rollup merge of #91144 - ehuss:update-cargo, r=ehuss 2021-11-22 23:30:32 +01:00
README.md
stage0.json bump boostrap compiler 2021-10-23 21:55:57 -04:00
version bump version to rust 1.58.0 2021-10-17 16:04:44 +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.