File tree 11 files changed +201
-80
lines changed
11 files changed +201
-80
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ error[E0369]: binary operation `%` cannot be applied to type `&&{integer}`
4
4
LL | x % 2 == 0
5
5
| ^^^^^
6
6
|
7
- = note: this is a reference to a type that `%` can be applied to; you need to dereference this variable once for this operation to work
8
- = note: an implementation of `std::ops::Rem` might be missing for `&&{integer}`
7
+ = help: `%` can be used on '{integer}', you can dereference `x`: `*x`
9
8
10
9
error: aborting due to previous error
11
10
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error[E0600]: cannot apply unary operator `!` to type `&'static str`
2
2
--> $DIR/issue-28308.rs:12:5
3
3
|
4
4
LL | assert!("foo");
5
- | ^^^^^^^^^^^^^^^
5
+ | ^^^^^^^^^^^^^^^ cannot apply unary operator `!`
6
6
7
7
error: aborting due to previous error
8
8
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ LL | LinkedList::new() += 1; //~ ERROR E0368
5
5
| -----------------^^^^^
6
6
| |
7
7
| cannot use `+=` on type `std::collections::LinkedList<_>`
8
+ |
9
+ = note: an implementation of `std::ops::AddAssign` might be missing for `std::collections::LinkedList<_>`
8
10
9
11
error[E0067]: invalid left-hand side expression
10
12
--> $DIR/E0067.rs:14:5
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error[E0600]: cannot apply unary operator `!` to type `&'static str`
2
2
--> $DIR/E0600.rs:12:5
3
3
|
4
4
LL | !"a"; //~ ERROR E0600
5
- | ^^^^
5
+ | ^^^^ cannot apply unary operator `!`
6
6
7
7
error: aborting due to previous error
8
8
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ LL | x += 2;
17
17
| -^^^^^
18
18
| |
19
19
| cannot use `+=` on type `&str`
20
+ |
21
+ = note: an implementation of `std::ops::AddAssign` might be missing for `&str`
20
22
21
23
error[E0599]: no method named `z` found for type `&str` in the current scope
22
24
--> $DIR/error-festival.rs:26:7
@@ -28,7 +30,9 @@ error[E0600]: cannot apply unary operator `!` to type `Question`
28
30
--> $DIR/error-festival.rs:29:5
29
31
|
30
32
LL | !Question::Yes;
31
- | ^^^^^^^^^^^^^^
33
+ | ^^^^^^^^^^^^^^ cannot apply unary operator `!`
34
+ |
35
+ = note: an implementation of `std::ops::Not` might be missing for `Question`
32
36
33
37
error[E0604]: only `u8` can be cast as `char`, not `u32`
34
38
--> $DIR/error-festival.rs:35:5
Original file line number Diff line number Diff line change @@ -2,13 +2,17 @@ error[E0600]: cannot apply unary operator `-` to type `usize`
2
2
--> $DIR/feature-gate-negate-unsigned.rs:20:23
3
3
|
4
4
LL | let _max: usize = -1;
5
- | ^^
5
+ | ^^ cannot apply unary operator `-`
6
+ |
7
+ = note: unsigned values cannot be negated
6
8
7
9
error[E0600]: cannot apply unary operator `-` to type `u8`
8
10
--> $DIR/feature-gate-negate-unsigned.rs:24:14
9
11
|
10
12
LL | let _y = -x;
11
- | ^^
13
+ | ^^ cannot apply unary operator `-`
14
+ |
15
+ = note: unsigned values cannot be negated
12
16
13
17
error: aborting due to 2 previous errors
14
18
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ LL | let x = |ref x: isize| { x += 1; };
5
5
| -^^^^^
6
6
| |
7
7
| cannot use `+=` on type `&isize`
8
+ |
9
+ = help: `+=` can be used on 'isize', you can dereference `x`: `*x`
8
10
9
11
error: aborting due to previous error
10
12
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error[E0600]: cannot apply unary operator `!` to type `!`
2
2
--> $DIR/expr_unary.rs:17:16
3
3
|
4
4
LL | let x: ! = ! { return; }; //~ ERROR unreachable
5
- | ^^^^^^^^^^^^^
5
+ | ^^^^^^^^^^^^^ cannot apply unary operator `!`
6
6
7
7
error: unreachable expression
8
8
--> $DIR/expr_unary.rs:17:16
Original file line number Diff line number Diff line change @@ -14,3 +14,7 @@ fn main() {
14
14
fn foo < T > ( x : T , y : T ) {
15
15
let z = x + y; //~ ERROR binary operation `+` cannot be applied to type `T`
16
16
}
17
+
18
+ fn bar < T > ( x : T ) {
19
+ x += x; //~ ERROR binary assignment operation `+=` cannot be applied to type `T`
20
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,17 @@ LL | let z = x + y; //~ ERROR binary operation `+` cannot be applied to type
6
6
|
7
7
= note: `T` might need a bound for `std::ops::Add`
8
8
9
- error: aborting due to previous error
9
+ error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
10
+ --> $DIR/missing_trait_impl.rs:19:5
11
+ |
12
+ LL | x += x; //~ ERROR binary assignment operation `+=` cannot be applied to type `T`
13
+ | -^^^^^
14
+ | |
15
+ | cannot use `+=` on type `T`
16
+ |
17
+ = note: `T` might need a bound for `std::ops::AddAssign`
18
+
19
+ error: aborting due to 2 previous errors
10
20
11
- For more information about this error, try `rustc --explain E0369`.
21
+ Some errors occurred: E0368, E0369.
22
+ For more information about an error, try `rustc --explain E0368`.
You can’t perform that action at this time.
0 commit comments