[patterns.ref.info] unclear wording: "and, thus, borrow them"
The first sentence of [patterns.ref.info] states (my emphasis):
Reference patterns dereference the pointers that are being matched and, thus, borrow them.
The emphasised part reads a bit confusing to me and I'm still unsure what is meant by it. Maybe it could be clarified? Or omitted? I can't find similar terminology in the FLS.
The URLO topic that raised the issue:
https://users.rust-lang.org/t/discussing-reference-patterns/130495?u=jofas
The phrase "borrow them" made me think of let (ref x, ref y) = tuple;, which feels like a different kind of borrowing than what's happening in &x patterns. Clarifying that would help.
Comes from this PR; I traced it back to original developer to see whether there were intermediate steps, but that line appears as it is, and was never modified.
The text seems to conflate that the &-pattern dereferences and also borrows, but as the FLS says, it only dereferences:
A reference pattern is a pattern that dereferences a pointer that is being matched.
Matching a String under & would move it, so it fails:
fn main() {
let s = "s".to_owned();
let s_ref = &s;
let &nope = s_ref;
}