diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2020-04-30 15:23:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-30 15:23:08 -0700 |
| commit | 4adebb9f29d862a0723ab982944a2909ea2fdcc1 (patch) | |
| tree | 861555cc7d3952840bfa2051175d4d63df73b034 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs | |
| parent | 7ced01a730e8fc1bae2f8d4369c26812c0484da4 (diff) | |
| parent | f654daf3a6681e6d412db1e3203801353b9089c7 (diff) | |
| download | rust-4adebb9f29d862a0723ab982944a2909ea2fdcc1.tar.gz rust-4adebb9f29d862a0723ab982944a2909ea2fdcc1.zip | |
Rollup merge of #71148 - bluss:vec-drop-raw-slice, r=RalfJung
Vec drop and truncate: drop using raw slice *mut [T]
By creating a *mut [T] directly (without going through &mut [T]), avoid
questions of validity of the contents of the slice.
Consider the following risky code:
```rust
unsafe {
let mut v = Vec::<bool>::with_capacity(16);
v.set_len(16);
}
```
The intention is that with this change, we avoid one of the soundness
questions about the above snippet, because Vec::drop no longer
produces a mutable slice of the vector's contents.
r? @RalfJung
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions
