SimplifyArmIdentity
can cause use-after-moves in MIR
#72800
Labels
A-mir-opt
Area: MIR optimizations
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Reduced example diff from
<core::slice::Iter<'a, T> as Iterator>::find_map
:Here, the
move _9
makes_9
uninitialized (inMaybeInitializedLocals
), but the next statement immediately uses it again viadiscriminant(_9)
.I do not believe that this is currently a soundness issue, as no analyses other than the generator transform (which runs earlier) should rely on this data. It is a problem for #72632 though, since that runs after
SimplifyArmIdentity
. Granted, the example above is unlikely to be problematic even for that, but other cases might be.The text was updated successfully, but these errors were encountered: