]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-22644.rs
New upstream version 1.30.0~beta.7+dfsg1
[rustc.git] / src / test / ui / issues / issue-22644.rs
1 // Copyright 2017 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 fn main() {
12 let a : u32 = 0;
13 let long_name : usize = 0;
14
15 println!("{}", a as usize > long_name);
16 println!("{}", a as usize < long_name); //~ ERROR `<` is interpreted as a start of generic
17 println!("{}{}", a as usize < long_name, long_name);
18 //~^ ERROR `<` is interpreted as a start of generic
19 println!("{}", a as usize < 4); //~ ERROR `<` is interpreted as a start of generic
20 println!("{}", a: usize > long_name);
21 println!("{}{}", a: usize < long_name, long_name);
22 //~^ ERROR `<` is interpreted as a start of generic
23 println!("{}", a: usize < 4); //~ ERROR `<` is interpreted as a start of generic
24
25 println!("{}", a
26 as
27 usize
28 < //~ ERROR `<` is interpreted as a start of generic
29 4);
30 println!("{}", a
31
32
33 as
34
35
36 usize
37 < //~ ERROR `<` is interpreted as a start of generic
38 5);
39
40 println!("{}", a as usize << long_name); //~ ERROR `<` is interpreted as a start of generic
41
42 println!("{}", a: &mut 4); //~ ERROR expected type, found `4`
43 }