about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2020-04-30 15:23:08 -0700
committerGitHub <noreply@github.com>2020-04-30 15:23:08 -0700
commit4adebb9f29d862a0723ab982944a2909ea2fdcc1 (patch)
tree861555cc7d3952840bfa2051175d4d63df73b034 /src/test/codegen/src-hash-algorithm
parent7ced01a730e8fc1bae2f8d4369c26812c0484da4 (diff)
parentf654daf3a6681e6d412db1e3203801353b9089c7 (diff)
downloadrust-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')
0 files changed, 0 insertions, 0 deletions