]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/match-range-fail-dominate.rs
auto merge of #17654 : gereeter/rust/no-unnecessary-cell, r=alexcrichton
[rust.git] / src / test / compile-fail / 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 fn main() {
18     match 5u {
19       1u ... 10u => { }
20       5u ... 6u => { }
21       _ => {}
22     };
23
24     match 5u {
25       3u ... 6u => { }
26       4u ... 6u => { }
27       _ => {}
28     };
29
30     match 5u {
31       4u ... 6u => { }
32       4u ... 6u => { }
33       _ => {}
34     };
35
36     match 'c' {
37       'A' ... 'z' => {}
38       'a' ... 'z' => {}
39       _ => {}
40     };
41
42     match 1.0f64 {
43       0.01f64 ... 6.5f64 => {}
44       0.02f64 => {}
45       _ => {}
46     };
47 }