Rollup merge of #144230 - RalfJung:option-as-slice-comment-fix, r=scottmcm
Option::as_slice: fix comment The implementation got changed in https://github.com/rust-lang/rust/pull/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 https://github.com/rust-lang/rust/pull/109179.) Cc `@GKFX` `@petrochenkov` `@llogiq` `@scottmcm`
This commit is contained in:
commit
95d9c8dfcb
1 changed files with 1 additions and 1 deletions
|
|
@ -842,7 +842,7 @@ impl<T> Option<T> {
|
|||
// just needs to be aligned, which it is because `&self` is aligned and
|
||||
// the offset used is a multiple of alignment.
|
||||
//
|
||||
// In the new version, the intrinsic always returns a pointer to an
|
||||
// Here we assume that `offset_of!` always returns an offset to an
|
||||
// in-bounds and correctly aligned position for a `T` (even if in the
|
||||
// `None` case it's just padding).
|
||||
unsafe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue