]> git.lizzy.rs Git - rust.git/blob - tests/ui/error-festival.rs
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / error-festival.rs
1 enum Question {
2     Yes,
3     No,
4 }
5
6 mod foo {
7     const FOO: u32 = 0;
8 }
9
10 fn main() {
11     let x = "a";
12     x += 2;
13     //~^ ERROR E0368
14     y = 2;
15     //~^ ERROR E0425
16     x.z();
17     //~^ ERROR E0599
18
19     !Question::Yes;
20     //~^ ERROR E0600
21
22     foo::FOO;
23     //~^ ERROR E0603
24
25     0u32 as char;
26     //~^ ERROR E0604
27
28     let x = 0u8;
29     x as Vec<u8>;
30     //~^ ERROR E0605
31
32     let x = 5;
33     let x_is_nonzero = x as bool;
34     //~^ ERROR E0054
35
36     let x = &0u8;
37     let y: u32 = x as u32;
38     //~^ ERROR E0606
39
40     let v = core::ptr::null::<u8>();
41     v as *const [u8];
42     //~^ ERROR E0607
43 }