Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1cefaa7

Browse files
authoredMay 11, 2024
Relax slice safety requirements
Per rust-lang#116677 (comment), the language as written promises too much. This PR relaxes the language to be consistent with current semantics. If and when rust-lang#117945 is implemented, we can revert to the old language.
1 parent 100b123 commit 1cefaa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎library/core/src/primitive_docs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ mod prim_usize {}
14681468
/// boundary, the following invariants must generally be upheld:
14691469
///
14701470
/// * `t` is aligned to `align_of_val(t)`
1471-
/// * `t` is dereferenceable for `size_of_val(t)` many bytes
1471+
/// * if `size_of_val(t) > 0`, then `t` is dereferenceable for `size_of_val(t)` many bytes
14721472
///
14731473
/// If `t` points at address `a`, being "dereferenceable" for N bytes means that the memory range
14741474
/// `[a, a + N)` is all contained within a single [allocated object].

0 commit comments

Comments
 (0)
Failed to load comments.