rust/library/alloc/src/vec
bors cedbe5c715 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.
2023-08-29 06:04:55 +00:00
..
cow.rs remove some unneeded imports 2023-04-12 19:27:18 +02:00
drain.rs enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
extract_if.rs remove unused field 2023-06-15 21:14:40 +02:00
in_place_collect.rs Mark internal functions and traits unsafe 2023-05-15 14:31:00 -04:00
in_place_drop.rs Fix leaking in inplace collection when destructor panics 2022-09-10 11:34:22 +02:00
into_iter.rs replace version placeholders 2023-04-28 08:47:55 -07:00
is_zero.rs Update IsZero documentation 2023-01-18 15:48:53 +00:00
mod.rs Auto merge of #113859 - Manishearth:vec-as-mut-ptr-stacked-borrow, r=dtolnay 2023-08-29 06:04:55 +00:00
partial_eq.rs Allow comparing Vecs with different allocators using == 2022-02-08 01:50:55 +00:00
set_len_on_drop.rs Tune RepeatWith::try_fold and Take::for_each and Vec::extend_trusted 2022-11-24 19:14:19 -08:00
spec_extend.rs Remove lifetime bound for A for impl Extend<&'a T> for Vec<T, A>. 2023-07-01 02:12:45 -05:00
spec_from_elem.rs Remove ExtendWith and ExtendElement 2023-06-04 15:55:34 +02:00
spec_from_iter.rs Update documentation of SpecFromIter to reflect the removed impls 2021-05-31 21:07:03 +02:00
spec_from_iter_nested.rs Improve estimation of capacity in Vec::from_iter 2022-01-19 09:47:49 -05:00
splice.rs enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00