-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Conflicting documentation on the alignment requirements for ptr::copy #62313
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The docs for
ptr::drop_in_placestate:And include an example which uses
ptr::copyto copy the value from an unaligned pointer into an aligned one. However, the docs forptr::copystate:Either the docs for
ptr::copyare wrong, andsrcdoes not need to be aligned, or the example fordrop_in_placeinvokes UB and should be updated to useread_unaligned