fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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