; mutex.lock may wait, so a second lock while holding a guard is rejected: lock-order deadlock is not expressible. ; expect: reject E4304 ; phase: 3 ; spec: docs/spec/04-concurrency-and-atomics.md module test.sync_lock_twice air 0 lang 0.1 features [cancellation, effects, ownership, sync, tasks] fn @f(%a: ref>, %b: ref>) -> void effects [task.wait] entry: mutex.lock %a, ok -> @la, cancelled -> @out la(%ga: guard): mutex.lock %b, ok -> @lb, cancelled -> @ub lb(%gb: guard): mutex.unlock %gb mutex.unlock %ga ret ub: mutex.unlock %ga ret out: ret