Missed optimization when using const-blocks for MaybeUninit arrays #138625
Labels
A-codegen
Area: Code generation
C-bug
Category: This is a bug.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Please see the assembly from these functions (Rust 1.85.0
--release
):The
const {}
variant compiles with code that seems to zero-out thearr
field. This should not be necessary and the other version (correctly) only initializes thelen
field.This is particularly troublesome because the documentation in multiple places expresses that const-blocks are the preferred way to create a
[MaybeUnint; _]
.The text was updated successfully, but these errors were encountered: