unary op filter, dereference hint

This commit is contained in:
Roman Stoliar 2018-05-08 22:20:41 +03:00
parent 2f6945c776
commit 56fbc63456
8 changed files with 132 additions and 79 deletions

View file

@ -4,8 +4,7 @@ error[E0369]: binary operation `%` cannot be applied to type `&&{integer}`
LL | x % 2 == 0
| ^^^^^
|
= 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
= note: an implementation of `std::ops::Rem` might be missing for `&&{integer}`
= help: `%` can be used on '&{integer}', you can dereference `x`: `*x`
error: aborting due to previous error

View file

@ -2,9 +2,7 @@ error[E0600]: cannot apply unary operator `!` to type `&'static str`
--> $DIR/issue-28308.rs:12:5
|
LL | assert!("foo");
| ^^^^^^^^^^^^^^^
|
= note: an implementation of `std::ops::Not` might be missing for `&'static str`
| ^^^^^^^^^^^^^^^ cannot apply unary operator `!`
error: aborting due to previous error

View file

@ -2,9 +2,7 @@ error[E0600]: cannot apply unary operator `!` to type `&'static str`
--> $DIR/E0600.rs:12:5
|
LL | !"a"; //~ ERROR E0600
| ^^^^
|
= note: an implementation of `std::ops::Not` might be missing for `&'static str`
| ^^^^ cannot apply unary operator `!`
error: aborting due to previous error

View file

@ -30,7 +30,7 @@ error[E0600]: cannot apply unary operator `!` to type `Question`
--> $DIR/error-festival.rs:29:5
|
LL | !Question::Yes;
| ^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^ cannot apply unary operator `!`
|
= note: an implementation of `std::ops::Not` might be missing for `Question`

View file

@ -2,17 +2,17 @@ error[E0600]: cannot apply unary operator `-` to type `usize`
--> $DIR/feature-gate-negate-unsigned.rs:20:23
|
LL | let _max: usize = -1;
| ^^
| ^^ cannot apply unary operator `-`
|
= note: an implementation of `std::ops::Neg` might be missing for `usize`
= note: unsigned values cannot be negated
error[E0600]: cannot apply unary operator `-` to type `u8`
--> $DIR/feature-gate-negate-unsigned.rs:24:14
|
LL | let _y = -x;
| ^^
| ^^ cannot apply unary operator `-`
|
= note: an implementation of `std::ops::Neg` might be missing for `u8`
= note: unsigned values cannot be negated
error: aborting due to 2 previous errors

View file

@ -6,7 +6,7 @@ LL | let x = |ref x: isize| { x += 1; };
| |
| cannot use `+=` on type `&isize`
|
= note: an implementation of `std::ops::AddAssign` might be missing for `&isize`
= help: `+=` can be used on 'isize', you can dereference `x`: `*x`
error: aborting due to previous error

View file

@ -2,9 +2,7 @@ error[E0600]: cannot apply unary operator `!` to type `!`
--> $DIR/expr_unary.rs:17:16
|
LL | let x: ! = ! { return; }; //~ ERROR unreachable
| ^^^^^^^^^^^^^
|
= note: an implementation of `std::ops::Not` might be missing for `!`
| ^^^^^^^^^^^^^ cannot apply unary operator `!`
error: unreachable expression
--> $DIR/expr_unary.rs:17:16