diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-09-03 20:10:10 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-09-03 20:10:10 -0400 |
| commit | 6c9549dd20511769c58e4a0fdd2ffb5c5de7a820 (patch) | |
| tree | b88e7b72711d4ba066402b0edd69ebe8f35bbe0c | |
| parent | 79ea0eed5b7dd2caa4410d7d7ce26e6314e5575f (diff) | |
| parent | 17fde3a34d8dfa07378cbff0f2552b41071e032f (diff) | |
| download | rust-6c9549dd20511769c58e4a0fdd2ffb5c5de7a820.tar.gz rust-6c9549dd20511769c58e4a0fdd2ffb5c5de7a820.zip | |
Rollup merge of #28216 - christopherdumas:fix_28196, r=steveklabnik
This is a docs change suggested in #28196. r? @steveklabnik
| -rw-r--r-- | src/doc/reference.md | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index dbcfafaf1c1..900d1306e05 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -3200,16 +3200,6 @@ let z = match x { &0 => "zero", _ => "some" }; assert_eq!(y, z); ``` -A pattern that's just an identifier, like `Nil` in the previous example, could -either refer to an enum variant that's in scope, or bind a new variable. The -compiler resolves this ambiguity by forbidding variable bindings that occur in -`match` patterns from shadowing names of variants that are in scope. For -example, wherever `List` is in scope, a `match` pattern would not be able to -bind `Nil` as a new name. The compiler interprets a variable pattern `x` as a -binding _only_ if there is no variant named `x` in scope. A convention you can -use to avoid conflicts is simply to name variants with upper-case letters, and -local variables with lower-case letters. - Multiple match patterns may be joined with the `|` operator. A range of values may be specified with `...`. For example: |
