about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/context.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-29 06:04:55 +0000
committerbors <bors@rust-lang.org>2023-08-29 06:04:55 +0000
commitcedbe5c715c1fa9359683c5f108bed2054ac258b (patch)
treeb6a36d3e498dc09dde2236d1d0ebe82a756aac3f /compiler/rustc_codegen_llvm/src/context.rs
parenta517049d8cd49b1a81249f68cdf24ecbadaf7e0d (diff)
parent7cea69c9a22fb2adec3ab78be281c8c5561a8b09 (diff)
downloadrust-cedbe5c715c1fa9359683c5f108bed2054ac258b.tar.gz
rust-cedbe5c715c1fa9359683c5f108bed2054ac258b.zip
Auto merge of #113859 - Manishearth:vec-as-mut-ptr-stacked-borrow, r=dtolnay
Add note that Vec::as_mut_ptr() does not materialize a reference to the internal buffer

See discussion on https://github.com/thomcc/rust-typed-arena/issues/62 and [t-opsem](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/is.20this.20typed_arena.20code.20sound.20under.20stacked.2Ftree.20borrows.3F)

This method already does the correct thing here, but it is worth guaranteeing that it does so it can be used more freely in unsafe code without having to worry about potential Stacked/Tree Borrows violations. This moves one more unsafe usage pattern from the "very likely sound but technically not fully defined" box into "definitely sound", and currently our surface area of the latter is woefully small.

I'm not sure how best to word this, opening this PR as a way to start discussion.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
0 files changed, 0 insertions, 0 deletions