Skip to content

Commit

Permalink
librustc: Forbid .. in range patterns.
Browse files Browse the repository at this point in the history
This breaks code that looks like:

    match foo {
        1..3 => { ... }
    }

Instead, write:

    match foo {
        1...3 => { ... }
    }

Closes rust-lang#17295.

[breaking-change]
  • Loading branch information
pcwalton authored and Manishearth committed Mar 2, 2017
1 parent 93be85f commit 5c2a580
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,7 @@ may be specified with `..`. For example:
let message = match x {
0 | 1 => "not many",
2 .. 9 => "a few",
2 ... 9 => "a few",
_ => "lots"
};
```
Expand Down

0 comments on commit 5c2a580

Please sign in to comment.