]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-festival.stderr
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[rust.git] / src / test / ui / error-festival.stderr
1 error[E0425]: cannot find value `y` in this scope
2   --> $DIR/error-festival.rs:14:5
3    |
4 LL |     y = 2;
5    |     ^ help: a local variable with a similar name exists: `x`
6
7 error[E0603]: constant `FOO` is private
8   --> $DIR/error-festival.rs:22:10
9    |
10 LL |     foo::FOO;
11    |          ^^^ private constant
12    |
13 note: the constant `FOO` is defined here
14   --> $DIR/error-festival.rs:7:5
15    |
16 LL |     const FOO: u32 = 0;
17    |     ^^^^^^^^^^^^^^^^^^^
18
19 error[E0368]: binary assignment operation `+=` cannot be applied to type `&str`
20   --> $DIR/error-festival.rs:12:5
21    |
22 LL |     x += 2;
23    |     -^^^^^
24    |     |
25    |     cannot use `+=` on type `&str`
26
27 error[E0599]: no method named `z` found for reference `&str` in the current scope
28   --> $DIR/error-festival.rs:16:7
29    |
30 LL |     x.z();
31    |       ^ method not found in `&str`
32
33 error[E0600]: cannot apply unary operator `!` to type `Question`
34   --> $DIR/error-festival.rs:19:5
35    |
36 LL |     !Question::Yes;
37    |     ^^^^^^^^^^^^^^ cannot apply unary operator `!`
38    |
39 note: an implementation of `Not` might be missing for `Question`
40   --> $DIR/error-festival.rs:1:1
41    |
42 LL | enum Question {
43    | ^^^^^^^^^^^^^ must implement `Not`
44 note: the following trait must be implemented
45   --> $SRC_DIR/core/src/ops/bit.rs:LL:COL
46    |
47 LL | / pub trait Not {
48 LL | |     /// The resulting type after applying the `!` operator.
49 LL | |     #[stable(feature = "rust1", since = "1.0.0")]
50 LL | |     type Output;
51 ...  |
52 LL | |     fn not(self) -> Self::Output;
53 LL | | }
54    | |_^
55
56 error[E0604]: only `u8` can be cast as `char`, not `u32`
57   --> $DIR/error-festival.rs:25:5
58    |
59 LL |     0u32 as char;
60    |     ^^^^^^^^^^^^ invalid cast
61
62 error[E0605]: non-primitive cast: `u8` as `Vec<u8>`
63   --> $DIR/error-festival.rs:29:5
64    |
65 LL |     x as Vec<u8>;
66    |     ^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
67
68 error[E0054]: cannot cast as `bool`
69   --> $DIR/error-festival.rs:33:24
70    |
71 LL |     let x_is_nonzero = x as bool;
72    |                        ^^^^^^^^^ help: compare with zero instead: `x != 0`
73
74 error[E0606]: casting `&u8` as `u32` is invalid
75   --> $DIR/error-festival.rs:37:18
76    |
77 LL |     let y: u32 = x as u32;
78    |                  -^^^^^^^
79    |                  |
80    |                  cannot cast `&u8` as `u32`
81    |                  help: dereference the expression: `*x`
82
83 error[E0607]: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]`
84   --> $DIR/error-festival.rs:41:5
85    |
86 LL |     v as *const [u8];
87    |     ^^^^^^^^^^^^^^^^
88
89 error: aborting due to 10 previous errors
90
91 Some errors have detailed explanations: E0054, E0368, E0425, E0599, E0600, E0603, E0604, E0605, E0606...
92 For more information about an error, try `rustc --explain E0054`.