-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Returning MaybeUninit consts generates code to zero out the return value. #83657
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-codegenArea: Code generationArea: Code generationA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen: Both functions to compile to just a return instruction
Instead, this happened: Only
bardid,foozeros the return value in release builds.Meta
rustc --version --verbose: