You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MIR: a cancellation poll between argument calls resets the earlier argument temporaries instead of dropping them (ownership audit: "reset of _4 on a path where it was never moved") #2570
with analyze <any program using BTreeMap> audit:all:
violation: ownership MIR: fn sym15651(BTreeMap.prefix__receiver__2886_3_3) stmt4 span=0: reset of _4 on a path where it was never moved: the value it holds is lost (§2.5.1)
The MIR
The cancellation polls (#2511: a callable parameter may suspend) between the argument calls give every cancel path a reset of the earlier argument temporaries instead of a drop:
bb6 (cancelled after the second argument) resets _4 (the first closure, never moved) and bb12 resets _4, _6, _10. The values are fn values without drop glue, so nothing leaks at runtime, but the MIR is wrong by its own rule (§2.5.1) and the audit, which the battery runs, is red. Binding the three results to lets first avoids it (the facade now does), which is a workaround, not a fix.
Expected
A cancel path drops the argument temporaries that are live at the poll (or ends their storage), never resets them.
Fixed in #2580 (c7fa606): a pending reset is emitted only once its move has happened. A flush asks the body whether a statement since the statement frame opened reads or drops the local, or a call terminator passes it; an unwind between a call's argument evaluations drops a still-owned argument temporary instead of resetting it. The unwinding call's result is stated unwritten at that return (MirBody.note_unwritten_at_return) and the ownership validator's leak rule reads the fact. Fixture behav_2570 runs the program and audit:all.
Activity
Phase 4: BTreeMap and BTreeSet over the M*LIB B+tree (D151); D152; D1…
Seven compiler fixes: literals at distinct demands (D153), element-pl…
ehartford commentedon Oct 23, 2026
Fixed in #2580 (c7fa606): a pending reset is emitted only once its move has happened. A flush asks the body whether a statement since the statement frame opened reads or drops the local, or a call terminator passes it; an unwind between a call's argument evaluations drops a still-owned argument temporary instead of resetting it. The unwinding call's result is stated unwritten at that return (MirBody.note_unwritten_at_return) and the ownership validator's leak rule reads the fact. Fixture behav_2570 runs the program and audit:all.