Issue #3024: A task::ChildHandle field lowers with the wrong number of generic arguments

Open and answer this issue on GitHub.

ready · opened 2026-12-01 · updated 2026-12-01 · 0 comments

Found while clarifying #3011 (async D20). A struct with a task::ChildHandle field passes the check, and then rustc fails on the lowered code: “struct takes 2 generic arguments”. The field is lowered with the wrong arity.

Probe:

struct Node { next: SharedMut[Node]?, h: task::ChildHandle[i64]? }

fn main() throws {
	async {
		let a = SharedMut(Node { next: null, h: async(handle) fn { 1 } })
		let b = SharedMut(Node { next: a, h: null })
		a.update(fn(mut v) { v.next = b })
	}
	print(1)
}

(Once NK2122 looks through containers, this probe should be refused there. That fix is “NK2122 misses a child handle inside a container” (#3023). The arity defect still needs fixing for a field that is allowed.)

To build

Done when that test compiles and runs.


Generated by Claude Code

Back to Open Issues