mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Relax slice safety requirements
Per https://github.com/rust-lang/rust/pull/116677#issuecomment-1945495786, the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when #117945 is implemented, we can revert to the old language.
This commit is contained in:
parent
100b123a0d
commit
1cefaa7432
@ -1468,7 +1468,7 @@ mod prim_usize {}
|
||||
/// boundary, the following invariants must generally be upheld:
|
||||
///
|
||||
/// * `t` is aligned to `align_of_val(t)`
|
||||
/// * `t` is dereferenceable for `size_of_val(t)` many bytes
|
||||
/// * if `size_of_val(t) > 0`, then `t` is dereferenceable for `size_of_val(t)` many bytes
|
||||
///
|
||||
/// If `t` points at address `a`, being "dereferenceable" for N bytes means that the memory range
|
||||
/// `[a, a + N)` is all contained within a single [allocated object].
|
||||
|
Loading…
Reference in New Issue
Block a user