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
{{ message }}
Repository navigation
View escape: Mutex.set(&self, value) stores a reference (or a callback handle) into longer-lived storage unchecked #1778
Found by the D71 facade work (#1611). A view passed to Mutex[T].set through &self escapes into storage that outlives it, and the checker accepts it:
type H = ephemeral { slot: Mutex[Option[&i32]] }
fn keep(h: &H):
let x = 5
h.slot.set(Some(&x)) // accepted; the stored reference dangles after keep returns
The same path lets a callback-scope handle (§16.2b.9) outlive its callback. Expected per §21.1 / D22: storing a view into a place requires the view's origin to outlive that place; this is refused. Mutex.set mutates through &self (interior mutability), which the view-escape check does not see as a store into the receiver.
Activity
D71 facade rulings: ok lists, valid on failed, callback-scope handles…
Views: a store records origins only when the stored value can hold a …
Views: a store into a place is a store into its root's storage, and a…
Views: a store records origins only when the stored value can hold a …
Closures and views: callable parameters are views; stores into a rece…