Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/borrow.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ and check_block (ctx : context) (state : state) (symbols : Symbol.t) (blk : bloc
statement we expire any ref-binding introduced in *this* block whose
binder's last use has already passed, releasing the underlying
borrow. This is the non-lexical-lifetimes win — patterns like
[let r = &x; print(*r); x = 2] now type-check, while the
[let r = &x; print( *r); x = 2] now type-check, while the
anti-aliasing rules remain sound because the borrow is still live
across statements that *do* use the binder. *)
let last_use = compute_last_use_index symbols blk in
Expand Down Expand Up @@ -1335,7 +1335,7 @@ let check_program (symbols : Symbol.t) (program : program) : unit result =
counts as the n-th statement); after each statement, check_block
releases the underlying borrow of any in-block ref-binding whose
binder is now dead. Unblocks the canonical NLL patterns
([let r = &x; print(*r); x = 2] and [let m = &mut x; let y = *m; x]),
([let r = &x; print( *r); x = 2] and [let m = &mut x; let y = *m; x]),
while still rejecting real conflicts (the anti-aliasing rules fire
against statements that *do* use the binder, before expiry).
Outer-block ref-bindings are deliberately preserved — they expire
Expand Down
Loading