-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Box sometimes forgets to drop its allocator when the Box is conditionally initialized. #131082
Copy link
Copy link
Closed
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-boxArea: Our favorite opsem complicationArea: Our favorite opsem complicationC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-boxArea: Our favorite opsem complicationArea: Our favorite opsem complicationC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected the program to output:
Instead it output:
Seems like there's something wrong with the drop flags.
Making
HasDropnot implementDropcauses the program to behave as expected.Meta
Reproducible on the playground with version
1.83.0-nightly (2024-09-30 fb4aebddd18d258046dd)