Auto merge of #94472 - JmPotato:use_maybeuninit_for_vecdeque, r=m-ou-se
Use MaybeUninit in VecDeque to remove the undefined behavior of slice
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Ref https://github.com/rust-lang/rust/issues/74189. Adjust the code to follow the [doc.rust-lang.org/reference/behavior-considered-undefined.html](https://doc.rust-lang.org/reference/behavior-considered-undefined.html).
* Change the return type of `buffer_as_slice` from `&[T]` to `&[MaybeUninit<T>]`.
* Add some corresponding safety comments.
Benchmark results:
master 8d6f527530
```rust
test collections::vec_deque::tests::bench_pop_back_100 ... bench: 47 ns/iter (+/- 1)
test collections::vec_deque::tests::bench_pop_front_100 ... bench: 50 ns/iter (+/- 4)
test collections::vec_deque::tests::bench_push_back_100 ... bench: 69 ns/iter (+/- 10)
test collections::vec_deque::tests::bench_push_front_100 ... bench: 72 ns/iter (+/- 6)
test collections::vec_deque::tests::bench_retain_half_10000 ... bench: 145,891 ns/iter (+/- 7,975)
test collections::vec_deque::tests::bench_retain_odd_10000 ... bench: 141,647 ns/iter (+/- 3,711)
test collections::vec_deque::tests::bench_retain_whole_10000 ... bench: 120,132 ns/iter (+/- 4,078)
```
This PR
```rust
test collections::vec_deque::tests::bench_pop_back_100 ... bench: 48 ns/iter (+/- 2)
test collections::vec_deque::tests::bench_pop_front_100 ... bench: 51 ns/iter (+/- 3)
test collections::vec_deque::tests::bench_push_back_100 ... bench: 73 ns/iter (+/- 2)
test collections::vec_deque::tests::bench_push_front_100 ... bench: 73 ns/iter (+/- 2)
test collections::vec_deque::tests::bench_retain_half_10000 ... bench: 131,796 ns/iter (+/- 5,440)
test collections::vec_deque::tests::bench_retain_odd_10000 ... bench: 137,563 ns/iter (+/- 3,349)
test collections::vec_deque::tests::bench_retain_whole_10000 ... bench: 128,815 ns/iter (+/- 3,289)
```