Skip to content

Conversation

@samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented Oct 28, 2025

replace_box is a new perf lint in Rust 1.92 which detects assignments of a newly created Box over an existing box instead of replacing the box content.

However, the lint triggers even when the target of the assignment has been moved and is no longer replaceable without reassignment. Until this is fixed, this lint is moved to nursery.

changelog: [replace_box]: move to nursery until a known bug has been fixed

r? flip1995

Summary Notes

Managed by @rustbot—see help for details

`replace_box` is a new `perf` lint in Rust 1.92 which detects assignments
of a newly created `Box` over an existing box instead of replacing the
box content.

However, the lint triggers even when the target of the assignment has
been moved and is no longer replaceable without reassignment. Until this
is fixed, this lint is moved to `nursery`.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 28, 2025
@samueltardieu
Copy link
Member Author

@rustbot note Do not merge before backport time
@rustbot label beta-nominated

This PR is to be merged only if issue #15968 has not been fixed when it's time to backport patches for Rust 1.92 around 2025-12-04.

Hopefully the issue will have been fixed and the fix will be backported instead.

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 28, 2025
@github-actions
Copy link

Lintcheck changes for d1e83ee

Lint Added Removed Changed
clippy::replace_box 0 0 2

This comment will be updated if you push new changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants