};
let mut err = self.fatal(&msg_exp);
if self.token.is_ident_named("and") {
- err.span_suggestion_with_applicability(
+ err.span_suggestion_short_with_applicability(
self.span,
"use `&&` instead of `and` for the boolean operator",
"&&".to_string(),
);
}
if self.token.is_ident_named("or") {
- err.span_suggestion_with_applicability(
+ err.span_suggestion_short_with_applicability(
self.span,
"use `||` instead of `or` for the boolean operator",
"||".to_string(),
}
if self.token.is_ident_named("and") {
- e.span_suggestion_with_applicability(
+ e.span_suggestion_short_with_applicability(
self.span,
"use `&&` instead of `and` for the boolean operator",
"&&".to_string(),
);
}
if self.token.is_ident_named("or") {
- e.span_suggestion_with_applicability(
+ e.span_suggestion_short_with_applicability(
self.span,
"use `||` instead of `or` for the boolean operator",
"||".to_string(),
--> $DIR/issue-54109-and_instead_of_ampersands.rs:14:10
|
LL | if a and b {
- | -- ^^^ help: use `&&` instead of `and` for the boolean operator: `&&`
+ | -- ^^^ help: use `&&` instead of `and` for the boolean operator
| |
| this `if` statement has a condition, but no block
--> $DIR/issue-54109-and_instead_of_ampersands.rs:23:10
|
LL | if a or b {
- | -- ^^ help: use `||` instead of `or` for the boolean operator: `||`
+ | -- ^^ help: use `||` instead of `or` for the boolean operator
| |
| this `if` statement has a condition, but no block
| ^^^
| |
| expected one of 8 possible tokens here
- | help: use `&&` instead of `and` for the boolean operator: `&&`
+ | help: use `&&` instead of `and` for the boolean operator
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found `or`
--> $DIR/issue-54109-and_instead_of_ampersands.rs:41:11
| ^^
| |
| expected one of 8 possible tokens here
- | help: use `||` instead of `or` for the boolean operator: `||`
+ | help: use `||` instead of `or` for the boolean operator
error: expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `and`
--> $DIR/issue-54109-and_instead_of_ampersands.rs:50:13
| ^^^
| |
| expected one of `!`, `.`, `::`, `?`, `{`, or an operator here
- | help: use `&&` instead of `and` for the boolean operator: `&&`
+ | help: use `&&` instead of `and` for the boolean operator
error: expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `or`
--> $DIR/issue-54109-and_instead_of_ampersands.rs:59:13
| ^^
| |
| expected one of `!`, `.`, `::`, `?`, `{`, or an operator here
- | help: use `||` instead of `or` for the boolean operator: `||`
+ | help: use `||` instead of `or` for the boolean operator
error: aborting due to 6 previous errors