Cross an async source's materialized input as an owned snapshot

This commit is contained in:
Dennis Kobert
2026-09-08 20:19:18 +00:00
parent e322d8957d
commit e92ced1e4a
2 changed files with 44 additions and 7 deletions

View File

@@ -264,6 +264,14 @@ fn validate_async_source(parsed: &ParsedNodeFn) {
"`async fn` source nodes cannot take `impl Node` inputs: the spawned future outlives any borrow of the graph, so it cannot evaluate other nodes; use the sync-prologue form (return `SourceFuture`) to evaluate lazy inputs before spawning"
);
}
// One level snapshots to one owned legacy list; a deeper input has no
// owned form to cross the future boundary with.
if matches!(&field.ty, ParsedFieldType::Regular(RegularParsedField { list_levels, .. }) if *list_levels > 1) {
emit_error!(
field.pat_ident.span(),
"`async fn` source nodes take a materialized input as an owned snapshot of one level, so nested `IList` is unsupported; flatten to a single `IList` or use the sync-prologue form (return `SourceFuture`)"
);
}
}
}
}