]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-festival.rs
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / error-festival.rs
1 // Copyright 2018 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 enum Question {
12     Yes,
13     No,
14 }
15
16 mod foo {
17     const FOO: u32 = 0;
18 }
19
20 fn main() {
21     let x = "a";
22     x += 2;
23     //~^ ERROR E0368
24     y = 2;
25     //~^ ERROR E0425
26     x.z();
27     //~^ ERROR E0599
28
29     !Question::Yes;
30     //~^ ERROR E0600
31
32     foo::FOO;
33     //~^ ERROR E0603
34
35     0u32 as char;
36     //~^ ERROR E0604
37
38     let x = 0u8;
39     x as Vec<u8>;
40     //~^ ERROR E0605
41
42     let x = 5;
43     let x_is_nonzero = x as bool;
44     //~^ ERROR E0054
45
46     let x = &0u8;
47     let y: u32 = x as u32;
48     //~^ ERROR E0606
49
50     let v = 0 as *const u8;
51     v as *const [u8];
52     //~^ ERROR E0607
53 }