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
Found during the #2987 manual audit of docs/spec/007_with-scoped-access.md (§§7.1, 7.5, 7.6, 7.7), docs/spec/005_ephemeral.md (§5.3), docs/spec/012_closures.md (§12.3), and docs/spec/014_concurrency.md (§14.3).
Gap
Across the specification (001_design-goals.md, 005_ephemeral.md, 007_with-scoped-access.md, 012_closures.md, 014_concurrency.md, denied-patterns.md), lock guards are acquired as:
with lock.lock() as data: / with lock.lock() as mut data: on Mutex[T]
with rw.read() as data: on RwLock[T] (returning RwReadGuard[T] / RwLockReadGuard[T])
with rw.write() as mut data: / with rw.write() as data: on RwLock[T] (returning RwWriteGuard[T] / RwLockWriteGuard[T])
In lib/std/sync.w:
Mutex and RwLock expose only enter() and enter_mut(), so lock.lock(), rw.read(), and 0-arg rw.write() all fail with unknown method.
Whole-value replacement is named Mutex.set(value) on Mutex (lib/std/sync.w:202) but RwLock.write(value) on RwLock (lib/std/sync.w:305), occupying the 0-arg RwLock.write() guard method name.
MutexGuardMut[T] and RwWriteGuard[T] implement ScopedMut[T] only, not Scoped[&T], so with lock.lock() as data: (§7.7) and with lock.write() as data: (§7.5, §14.3) cannot bind an immutable &T view.
005_ephemeral.md:45 names RwLockReadGuard[T] and RwLockWriteGuard[T], while lib/std/sync.w exports only RwReadGuard[T] and RwWriteGuard[T].
src/SemaCheck.w:35441, 35602-35604 checks may_suspend and view-escape on enter/enter_mut/set/write and must cover lock/read/write/set.
Activity
#3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 …