Skip to content

Commit 9a10260

Browse files
authored
Merge pull request rust-lang#2288 from rust-lang/TC/cover-str-in-wide-pointer-metadata-rule
Cover `str` in the wide-pointer metadata rule
2 parents 9380c88 + 082d04d commit 9a10260

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/behavior-considered-undefined.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ r[undefined.validity.reference-box]
147147
r[undefined.validity.wide]
148148
* The [metadata] of a wide reference, [`Box<T>`], or raw pointer must match the type of the [unsized tail]:
149149
* `dyn Trait` metadata must be a pointer to a compiler-generated vtable for `Trait`. (For raw pointers, this requirement remains a subject of some debate.)
150-
* Slice (`[T]`) metadata must be a valid `usize`. Furthermore, for wide references and [`Box<T>`], slice metadata is invalid if it makes the total size of the pointed-to value bigger than `isize::MAX`.
150+
* Slice (`[T]`) and `str` metadata must be a valid `usize`. Furthermore, for wide references and [`Box<T>`], this metadata is invalid if it makes the total size of the pointed-to value bigger than `isize::MAX`.
151151

152152
r[undefined.validity.valid-range]
153153
* If a type has a custom range of valid values, then a valid value must be in that range. In the standard library, this affects [`NonNull<T>`] and [`NonZero<T>`].

0 commit comments

Comments
 (0)