]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsigned-literal-negation.stderr
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / unsigned-literal-negation.stderr
1 error[E0600]: cannot apply unary operator `-` to type `usize`
2   --> $DIR/unsigned-literal-negation.rs:2:13
3    |
4 LL |     let x = -1 as usize;
5    |             ^^
6    |             |
7    |             cannot apply unary operator `-`
8    |             help: you may have meant the maximum value of `usize`: `usize::MAX`
9    |
10    = note: unsigned values cannot be negated
11
12 error[E0600]: cannot apply unary operator `-` to type `usize`
13   --> $DIR/unsigned-literal-negation.rs:3:13
14    |
15 LL |     let x = (-1) as usize;
16    |             ^^^^
17    |             |
18    |             cannot apply unary operator `-`
19    |             help: you may have meant the maximum value of `usize`: `usize::MAX`
20    |
21    = note: unsigned values cannot be negated
22
23 error[E0600]: cannot apply unary operator `-` to type `u32`
24   --> $DIR/unsigned-literal-negation.rs:4:18
25    |
26 LL |     let x: u32 = -1;
27    |                  ^^
28    |                  |
29    |                  cannot apply unary operator `-`
30    |                  help: you may have meant the maximum value of `u32`: `u32::MAX`
31    |
32    = note: unsigned values cannot be negated
33
34 error: aborting due to 3 previous errors
35
36 For more information about this error, try `rustc --explain E0600`.