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
A Task used after join_cleanup() is accepted, and the ownership validator does not flag the copy of the moved handle #1993
Found while fixing #1990 (branch wave-cancel, after its fix lands).
join_cleanup cancels the task, awaits its cleanup and frees its result buffer: it releases the handle, and since #1990 the MIR moves an owned Task binding into the cleanup await. But Sema types it as an observer (check_method_call "Task/ScopedTask surface methods", SemaCheck.w: returns Unit, never marks the receiver moved), so a later use is accepted:
use std.task.Task
async fn word() -> str: "hello" ++ " world"
async fn main:
let t = word()
t.join_cleanup()
let s = t.await
print(s)
with check --validate-all: validate-all: ok. The MIR reads copy _1 after move _1; the ownership validator does not report a use of a Moved local (a tool that stayed silent).
run --debug-alloc (WITH_ALLOC_NO_REUSE=1): prints an empty line, leak count=0. An await of a released handle produced a value.
Two questions for a ruling, since join_cleanup is not in the specification at all (no hit under docs/spec): is it user surface (then §14.7 should state that it consumes the Task, and Sema marks the receiver moved: a use after it is "use of moved value"), or library-internal (then user code should not reach it)?
Independently of the ruling: the ownership validator should reject a copy/move of a local whose state is Moved on that path.
Activity
join_cleanup consumes its Task: a later use is a use of a moved value…
join_cleanup consumes its Task: a later use is a use of a moved value…
select await takes each task once per arm path; arm temporaries drop …
`.await` consumes the task: a later read is a use of a moved value (#…
join_cleanup consumes its Task: a later use is a use of a moved value…
select await takes each task once per arm path; arm temporaries drop …
`.await` consumes the task: a later read is a use of a moved value (#…
join_cleanup consumes its Task: a later use is a use of a moved value…
select await takes each task once per arm path; arm temporaries drop …
`.await` consumes the task: a later read is a use of a moved value (#…
One implementation of the fixes this branch shared with #2049
join_cleanup consumes its Task: a later use is a use of a moved value…
select await takes each task once per arm path; arm temporaries drop …
`.await` consumes the task: a later read is a use of a moved value (#…
One implementation of the fixes this branch shared with #2049
Cancellation: indirect callees that may suspend get the cancelled-ret…
ehartford commentedon Oct 4, 2026
Fixed on main in 8cc883a (stack #2072, ten PRs; seed-driven battery GREEN on 92add22, tree identical to main).