]> git.lizzy.rs Git - rust.git/blob - src/test/ui/match/match-range-fail-dominate.rs
Auto merge of #53289 - ljedrz:improve_lexer, r=michaelwoerister
[rust.git] / src / test / ui / match / match-range-fail-dominate.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 //error-pattern: unreachable
12 //error-pattern: unreachable
13 //error-pattern: unreachable
14 //error-pattern: unreachable
15 //error-pattern: unreachable
16
17 #![deny(unreachable_patterns)]
18
19 fn main() {
20     match 5 {
21       1 ... 10 => { }
22       5 ... 6 => { }
23       _ => {}
24     };
25
26     match 5 {
27       3 ... 6 => { }
28       4 ... 6 => { }
29       _ => {}
30     };
31
32     match 5 {
33       4 ... 6 => { }
34       4 ... 6 => { }
35       _ => {}
36     };
37
38     match 'c' {
39       'A' ... 'z' => {}
40       'a' ... 'z' => {}
41       _ => {}
42     };
43
44     match 1.0f64 {
45       0.01f64 ... 6.5f64 => {}
46       0.02f64 => {}
47       _ => {}
48     };
49 }