[Accepted with modifications] SE-0519 "Borrow and Inout types for safe, first-class references"

Hi all,

The review of SE-0519: Borrow and Inout types for safe, first-class references concluded on March 17, 2026 but was extended for additional discussion regarding the naming of these types. The language steering group has decided the proposal should be accepted with modifications.

The LSG has changed the names of these types to Ref and MutableRef. The extended review thread did not produce a clear consensus on naming, and the LSG feels that these names provide the right balance relative to other names that were proposed:

  • Ref matches the way we refer to these entities as "references". Trying to explain them as "borrows" (which is odd as a noun for these entities) or "borrow types" (which is odd in our value-centric lifetime system) was awkward, affecting how we talk about and teach these types. This does mean that we do not have uniformity of terms with borrowing parameters and accessors, which had motivated the original name of Borrow.

  • The conceptual overlap with "reference types" (like classes) is generally a helpful association. Reference types are referenced, not copied. You can create a Ref<T> to store a (conceptual) reference to a T. The fact that there's an optimization where we copy small values rather than store them indirectly doesn't invalidate that the type operates like a reference, because it is an implementation detail rather than part of the language model.

  • These names follow the MutableXYZ pattern that is well-established in the standard library. That pattern does not work as well with other alternatives discussed (like Borrow, where "mutable borrow" is a phrase we've been trying to avoid) and had been missing in the original proposal (Borrow and Inout).

  • Ref and MutableRef are conceptually similar to single-element versions of Span and MutableSpan, and the Ref naming provides a better connection between these related concepts.

  • Although preferred by some, the LSG felt that spelling out the full term Reference did not add clarity over Ref. These types are expected to be used often enough that the length of the type name will matter to the conciseness of code making heavy use of lifetimes. It's common for core standard library types to be abbreviated (Int vs Integer , Float vs FloatingPoint ) and the LSG considers "ref" to be a abbreviated term of art in a number of languages.

    Thank you,
    Doug Gregor
    Review Manager

43 Likes