Skip to content

Commit 17fde3a

Browse files
author
christopherdumas
committed
Removed incorrect reference from #28196
1 parent b7b1dce commit 17fde3a

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/doc/reference.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,16 +3200,6 @@ let z = match x { &0 => "zero", _ => "some" };
32003200
assert_eq!(y, z);
32013201
```
32023202

3203-
A pattern that's just an identifier, like `Nil` in the previous example, could
3204-
either refer to an enum variant that's in scope, or bind a new variable. The
3205-
compiler resolves this ambiguity by forbidding variable bindings that occur in
3206-
`match` patterns from shadowing names of variants that are in scope. For
3207-
example, wherever `List` is in scope, a `match` pattern would not be able to
3208-
bind `Nil` as a new name. The compiler interprets a variable pattern `x` as a
3209-
binding _only_ if there is no variant named `x` in scope. A convention you can
3210-
use to avoid conflicts is simply to name variants with upper-case letters, and
3211-
local variables with lower-case letters.
3212-
32133203
Multiple match patterns may be joined with the `|` operator. A range of values
32143204
may be specified with `...`. For example:
32153205

0 commit comments

Comments
 (0)