@@ -331,8 +331,8 @@ Example using `let`:
331
331
struct Foo (i32 );
332
332
333
333
// Note that these rules apply to any pattern matching
334
- // whether it be in a `match` or a `let`. So, for example,
335
- // `x` here is a ref binding:
334
+ // whether it be in a `match` or a `let`.
335
+ // For example, `x` here is a ` ref` binding:
336
336
let Foo (x ) = & Foo (3 );
337
337
338
338
// Desugared:
@@ -395,7 +395,7 @@ experience more straightforward and requiring fewer manual reference gymnastics.
395
395
# Alternatives
396
396
[ alternatives ] : #alternatives
397
397
398
- - We could only infer ` ref ` , leaving users to manually specify the ` mut ` in
398
+ 1 . We could only infer ` ref ` , leaving users to manually specify the ` mut ` in
399
399
` ref mut ` bindings. This has the advantage of keeping mutability explicit.
400
400
Unfortunately, it also has some unintuitive results. ` ref mut ` doesn't actually
401
401
produce mutable bindings-- it produces immutably-bound mutable references.
@@ -440,12 +440,12 @@ Forcing users to manually specify `mut` in reference bindings would
440
440
be inconsistent with Rust's current semantics, and would result in confusing
441
441
errors.
442
442
443
- - We could support auto-ref / deref as suggested in
443
+ 2 . We could support auto-ref / deref as suggested in
444
444
[ the original match ergonomics RFC.] ( https://github.com/rust-lang/rfcs/pull/1944 )
445
445
This approach has troublesome interaction with
446
446
backwards-compatibility, and it becomes more difficult for the user to reason
447
447
about whether they've borrowed or moved a value.
448
- - We could allow writing ` move ` in patterns.
448
+ 3 . We could allow writing ` move ` in patterns.
449
449
Without this, ` move ` , unlike ` ref ` and ` ref mut ` , would always be implicit,
450
450
leaving no way override a default binding mode of ` ref ` or ` ref mut ` and move
451
451
the value out from behind a reference.
0 commit comments