diff options
| author | bors <bors@rust-lang.org> | 2021-11-23 17:44:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-23 17:44:33 +0000 |
| commit | 7b3cd075bbe309031b418650a9c32baf0b4a3276 (patch) | |
| tree | 3497a521d0204eb2a83f6659c429c50576ebd693 /compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs | |
| parent | 311fa1f14dd8ffbbe83b229a94b17f7f1ecaf33b (diff) | |
| parent | 22d937ddfc64bdf1f8724a27a782f2da2ae72be0 (diff) | |
| download | rust-7b3cd075bbe309031b418650a9c32baf0b4a3276.tar.gz rust-7b3cd075bbe309031b418650a9c32baf0b4a3276.zip | |
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`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs')
0 files changed, 0 insertions, 0 deletions
