You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the release notes text for #155750.
cc @WaffleLapkin, @jhpratt -- original issue/PR authors and assignees for drafting text
See the forge.rust-lang.org chapter about release notes for an overview of how the release team makes use of these tracking issues.
Release notes text
This section should be edited to specify the correct category(s) for the change, with succinct description(s) of what changed. Some things worth considering:
Does this need an additional compat notes section?
Was this a libs stabilization that should have additional headers to list new APIs under Stabilized APIs and Const Stabilized APIs?
# Libraries-[Document that `ManuallyDrop`'s `Box` interaction has been fixed](https://github.com/rust-lang/rust/pull/155750)
Tip
Use the previous releases for inspiration on how to write the release notes text and which categories to pick.
Release blog section
If this change is notable enough for inclusion in the blog post then this section should be edited to contain a draft for the blog post. Otherwise leave it empty.
# Fix to the `ManuallyDrop` and `Box` interaction
Prior to Rust 1.96.0, there was a bug in the Rust compiler, which made the following code undefined behavior:
```rustletmutx=ManuallyDrop::new(Box::new(1));
unsafe { ManuallyDrop::drop(&mutx) }
letx=x; // UB!```
This is because the compiler considers moving a `Box` that has been dropped (deallocated) undefined behavior, and `ManuallyDrop` used to propagate that, such that moving `ManuallyDrop<Box<_>>` where the box has been dropped would also be considered UB.
In Rust 1.96.0 we fixed this, so this code is no longer UB. In this release we have updated the `ManuallyDrop` documentation, providing a stable guarantee that this code will not be UB in the future as well. See [`ManuallyDrop` docs](TODO) and the [related RFC](https://rust-lang.github.io/rfcs/3336-maybe-dangling.html) for more information.
Note
If a blog post section is required the release-blog-post label should be added (@rustbot label +release-blog-post) to this issue as otherwise it may be missed by the release team.
This issue tracks the release notes text for #155750.
cc @WaffleLapkin, @jhpratt -- original issue/PR authors and assignees for drafting text
See the forge.rust-lang.org chapter about release notes for an overview of how the release team makes use of these tracking issues.
Release notes text
This section should be edited to specify the correct category(s) for the change, with succinct description(s) of what changed. Some things worth considering:
Stabilized APIsandConst Stabilized APIs?Tip
Use the previous releases for inspiration on how to write the release notes text and which categories to pick.
Release blog section
If this change is notable enough for inclusion in the blog post then this section should be edited to contain a draft for the blog post. Otherwise leave it empty.
Note
If a blog post section is required the
release-blog-postlabel should be added (@rustbot label +release-blog-post) to this issue as otherwise it may be missed by the release team.