about summary refs log tree commit diff
path: root/library/core/src/slice/raw.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-04 07:55:44 +0000
committerbors <bors@rust-lang.org>2022-09-04 07:55:44 +0000
commit8521a8c92da6c0c845d4f6394e903651a227946a (patch)
tree18fff039f86b368a19865a2c5a563987ef4185d3 /library/core/src/slice/raw.rs
parentc2d140bd36e7fcdc894b7c342fd81a63fdd66373 (diff)
parentfbcc038a224e58f7d3aca25c7f2321f11ce5513d (diff)
downloadrust-8521a8c92da6c0c845d4f6394e903651a227946a.tar.gz
rust-8521a8c92da6c0c845d4f6394e903651a227946a.zip
Auto merge of #100726 - jswrenn:transmute, r=oli-obk
safe transmute: use `Assume` struct to provide analysis options

This task was left as a TODO in #92268; resolving it brings [`BikeshedIntrinsicFrom`](https://doc.rust-lang.org/nightly/core/mem/trait.BikeshedIntrinsicFrom.html) more in line with the API defined in [MCP411](https://github.com/rust-lang/compiler-team/issues/411).

**Before:**
```rust
pub unsafe trait BikeshedIntrinsicFrom<
    Src,
    Context,
    const ASSUME_ALIGNMENT: bool,
    const ASSUME_LIFETIMES: bool,
    const ASSUME_VALIDITY: bool,
    const ASSUME_VISIBILITY: bool,
> where
    Src: ?Sized,
{}
```
**After:**
```rust
pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
where
    Src: ?Sized,
{}
```

`Assume::visibility` has also been renamed to `Assume::safety`, as library safety invariants are what's actually being assumed; visibility is just the mechanism by which it is currently checked (and that may change).

r? `@oli-obk`

---

Related:
- https://github.com/rust-lang/compiler-team/issues/411
- https://github.com/rust-lang/rust/issues/99571
Diffstat (limited to 'library/core/src/slice/raw.rs')
0 files changed, 0 insertions, 0 deletions