Skip to content

Commit 410dbd3

Browse files
authored
Unrolled build for #144230
Rollup merge of #144230 - RalfJung:option-as-slice-comment-fix, r=scottmcm Option::as_slice: fix comment The implementation got changed in #117525 without updating the comment. Now the comment makes no sense any more since there is no intrinsic that returns a pointer in this function any more. (It is also very strange to say "in the new version" in a comment -- what is that supposed to tell someone reading the code 2 years later? That wording was introduced even earlier, in #109179.) Cc `@GKFX` `@petrochenkov` `@llogiq` `@scottmcm`
2 parents e05ab47 + d2be1c8 commit 410dbd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ impl<T> Option<T> {
842842
// just needs to be aligned, which it is because `&self` is aligned and
843843
// the offset used is a multiple of alignment.
844844
//
845-
// In the new version, the intrinsic always returns a pointer to an
845+
// Here we assume that `offset_of!` always returns an offset to an
846846
// in-bounds and correctly aligned position for a `T` (even if in the
847847
// `None` case it's just padding).
848848
unsafe {

0 commit comments

Comments
 (0)