]> git.proxmox.com Git - rustc.git/blame - src/test/ui/error-festival.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / error-festival.stderr
CommitLineData
0531ce1d 1error[E0425]: cannot find value `y` in this scope
0731742a 2 --> $DIR/error-festival.rs:14:5
0531ce1d
XL
3 |
4LL | y = 2;
0731742a 5 | ^ help: a local variable with a similar name exists: `x`
0531ce1d
XL
6
7error[E0603]: constant `FOO` is private
0731742a 8 --> $DIR/error-festival.rs:22:10
0531ce1d
XL
9 |
10LL | foo::FOO;
ba9703b0 11 | ^^^ private constant
dfeec247
XL
12 |
13note: the constant `FOO` is defined here
14 --> $DIR/error-festival.rs:7:5
15 |
16LL | const FOO: u32 = 0;
17 | ^^^^^^^^^^^^^^^^^^^
0531ce1d
XL
18
19error[E0368]: binary assignment operation `+=` cannot be applied to type `&str`
0731742a 20 --> $DIR/error-festival.rs:12:5
0531ce1d
XL
21 |
22LL | x += 2;
23 | -^^^^^
24 | |
25 | cannot use `+=` on type `&str`
26
dfeec247 27error[E0599]: no method named `z` found for reference `&str` in the current scope
0731742a 28 --> $DIR/error-festival.rs:16:7
0531ce1d
XL
29 |
30LL | x.z();
e1599b0c 31 | ^ method not found in `&str`
0531ce1d
XL
32
33error[E0600]: cannot apply unary operator `!` to type `Question`
0731742a 34 --> $DIR/error-festival.rs:19:5
0531ce1d
XL
35 |
36LL | !Question::Yes;
94b46f34
XL
37 | ^^^^^^^^^^^^^^ cannot apply unary operator `!`
38 |
39 = note: an implementation of `std::ops::Not` might be missing for `Question`
0531ce1d
XL
40
41error[E0604]: only `u8` can be cast as `char`, not `u32`
0731742a 42 --> $DIR/error-festival.rs:25:5
0531ce1d
XL
43 |
44LL | 0u32 as char;
f035d41b 45 | ^^^^^^^^^^^^ invalid cast
0531ce1d 46
1b1a35ee 47error[E0605]: non-primitive cast: `u8` as `Vec<u8>`
0731742a 48 --> $DIR/error-festival.rs:29:5
0531ce1d
XL
49 |
50LL | x as Vec<u8>;
f035d41b 51 | ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
0531ce1d
XL
52
53error[E0054]: cannot cast as `bool`
0731742a 54 --> $DIR/error-festival.rs:33:24
0531ce1d
XL
55 |
56LL | let x_is_nonzero = x as bool;
0731742a 57 | ^^^^^^^^^ help: compare with zero instead: `x != 0`
0531ce1d
XL
58
59error[E0606]: casting `&u8` as `u32` is invalid
0731742a 60 --> $DIR/error-festival.rs:37:18
0531ce1d
XL
61 |
62LL | let y: u32 = x as u32;
0731742a
XL
63 | -^^^^^^^
64 | |
65 | cannot cast `&u8` as `u32`
66 | help: dereference the expression: `*x`
0531ce1d
XL
67
68error[E0607]: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]`
0731742a 69 --> $DIR/error-festival.rs:41:5
0531ce1d
XL
70 |
71LL | v as *const [u8];
72 | ^^^^^^^^^^^^^^^^
73
74error: aborting due to 10 previous errors
75
48663c56 76Some errors have detailed explanations: E0054, E0368, E0425, E0599, E0600, E0603, E0604, E0605, E0606...
0531ce1d 77For more information about an error, try `rustc --explain E0054`.