fix 101793, fix the wording of help msg for bitwise not
This commit is contained in:
parent
c3f59295fe
commit
2194fc957a
5 changed files with 17 additions and 7 deletions
|
@ -55,7 +55,7 @@ parser_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
|
||||||
.suggestion = use `!` to perform bitwise not
|
.suggestion = use `!` to perform bitwise not
|
||||||
|
|
||||||
parser_unexpected_token_after_not = unexpected {$negated_desc} after identifier
|
parser_unexpected_token_after_not = unexpected {$negated_desc} after identifier
|
||||||
.suggestion = use `!` to perform logical negation
|
.suggestion = use `!` to perform bitwise not
|
||||||
|
|
||||||
parser_malformed_loop_label = malformed loop label
|
parser_malformed_loop_label = malformed loop label
|
||||||
.suggestion = use the correct loop label format
|
.suggestion = use the correct loop label format
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _x = !1; //~ ERROR cannot be used as a unary operator
|
let _x = !1; //~ ERROR cannot be used as a unary operator
|
||||||
|
let _y = !1; //~ ERROR unexpected `1` after identifier
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _x = ~1; //~ ERROR cannot be used as a unary operator
|
let _x = ~1; //~ ERROR cannot be used as a unary operator
|
||||||
|
let _y = not 1; //~ ERROR unexpected `1` after identifier
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,13 @@ error: `~` cannot be used as a unary operator
|
||||||
LL | let _x = ~1;
|
LL | let _x = ~1;
|
||||||
| ^ help: use `!` to perform bitwise not
|
| ^ help: use `!` to perform bitwise not
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: unexpected `1` after identifier
|
||||||
|
--> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18
|
||||||
|
|
|
||||||
|
LL | let _y = not 1;
|
||||||
|
| ----^
|
||||||
|
| |
|
||||||
|
| help: use `!` to perform bitwise not
|
||||||
|
|
||||||
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error: unexpected `for_you` after identifier
|
||||||
LL | if not for_you {
|
LL | if not for_you {
|
||||||
| ----^^^^^^^
|
| ----^^^^^^^
|
||||||
| |
|
| |
|
||||||
| help: use `!` to perform logical negation
|
| help: use `!` to perform bitwise not
|
||||||
|
|
||||||
error: unexpected `the_worst` after identifier
|
error: unexpected `the_worst` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
|
||||||
|
@ -12,13 +12,13 @@ error: unexpected `the_worst` after identifier
|
||||||
LL | while not the_worst {
|
LL | while not the_worst {
|
||||||
| ----^^^^^^^^^
|
| ----^^^^^^^^^
|
||||||
| |
|
| |
|
||||||
| help: use `!` to perform logical negation
|
| help: use `!` to perform bitwise not
|
||||||
|
|
||||||
error: unexpected `println` after identifier
|
error: unexpected `println` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9
|
||||||
|
|
|
|
||||||
LL | if not // lack of braces is [sic]
|
LL | if not // lack of braces is [sic]
|
||||||
| ----- help: use `!` to perform logical negation
|
| ----- help: use `!` to perform bitwise not
|
||||||
LL | println!("Then when?");
|
LL | println!("Then when?");
|
||||||
| ^^^^^^^
|
| ^^^^^^^
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ error: unexpected `2` after identifier
|
||||||
LL | let resource = not 2;
|
LL | let resource = not 2;
|
||||||
| ----^
|
| ----^
|
||||||
| |
|
| |
|
||||||
| help: use `!` to perform logical negation
|
| help: use `!` to perform bitwise not
|
||||||
|
|
||||||
error: unexpected `be_smothered_out_before` after identifier
|
error: unexpected `be_smothered_out_before` after identifier
|
||||||
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
|
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
|
||||||
|
@ -50,7 +50,7 @@ error: unexpected `be_smothered_out_before` after identifier
|
||||||
LL | let young_souls = not be_smothered_out_before;
|
LL | let young_souls = not be_smothered_out_before;
|
||||||
| ----^^^^^^^^^^^^^^^^^^^^^^^
|
| ----^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
| |
|
| |
|
||||||
| help: use `!` to perform logical negation
|
| help: use `!` to perform bitwise not
|
||||||
|
|
||||||
error: aborting due to 6 previous errors
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue