Skip to content
Playground(another site)

bynk.par.question_in_join

Error A ? appears inside a par { … } binding. ? takes a Result value, not an effect, so a binding's own result is unwrapped after the block (let user = userR?), where the ? lines run in source order; a ? on an argument is computed before the block.

The bindings of a par block are issued together and the block waits for all of them, so a ? inside one has no single place to return from. Bind each effect's Result in the block and apply ? after it, where the lines run in source order and the first Err propagates. A ? on an argument can be computed before the block instead.

Example

par {
let a <- Users.find(1)
let b <- Orders.forUser(parse(raw)?) // ✗ `?` inside the block
}
let key = parse(raw)? // ✓ unwrap it before the block
par {
let a <- Users.find(1)
let b <- Orders.forUser(key)
}

In the Book

See also

  • The grammar rule it governs: par_stmt.
  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.par.question_in_join shows the same from the installed toolchain, without a network.