diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-28 22:56:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-28 22:56:45 +0200 |
| commit | 4751c85e50bdb3ecf529fba2b50cff20330085ff (patch) | |
| tree | e9a50509d04d13543c728337a999425da8096a8a /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 33f15e899d922419c3fe447e4cd24ced90c008a9 (diff) | |
| parent | 618841b8156a85ff937b755626eae0983c05da25 (diff) | |
| download | rust-4751c85e50bdb3ecf529fba2b50cff20330085ff.tar.gz rust-4751c85e50bdb3ecf529fba2b50cff20330085ff.zip | |
Rollup merge of #110921 - JohnBobbo96:rustc_arena_nonnull, r=Nilstrieb
Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`. This avoids a few extra dereferences as well as an `unwrap`. According to the docs for [`NonNull::len`](https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.len) this also ensures that: > This function is safe, even when the non-null raw slice cannot be dereferenced to a slice because the pointer does not have a valid address. I am also fairly sure that the `unwrap` is unneeded in this case, as the docs for [`Box::into_raw`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method.into_raw) also state: > Consumes the Box, returning a wrapped raw pointer. **The pointer will be properly aligned and non-null.**
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
