]> git.lizzy.rs Git - rust.git/commitdiff
issue 54109: use short suggestions
authorVitaly _Vi Shukela <vi0oss@gmail.com>
Fri, 14 Sep 2018 23:05:32 +0000 (02:05 +0300)
committerVitaly _Vi Shukela <vi0oss@gmail.com>
Fri, 14 Sep 2018 23:05:32 +0000 (02:05 +0300)
src/libsyntax/parse/parser.rs
src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr

index 429d1b6bf5e8fa446d7db168439a220e2c321872..48e034b117f187857dc3334c4b8cbece92b75aaf 100644 (file)
@@ -733,7 +733,7 @@ fn tokens_to_string(tokens: &[TokenType]) -> String {
             };
             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(),
@@ -741,7 +741,7 @@ fn tokens_to_string(tokens: &[TokenType]) -> 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(),
@@ -4768,7 +4768,7 @@ pub fn parse_block(&mut self) -> PResult<'a, P<Block>> {
             }
 
             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(),
@@ -4776,7 +4776,7 @@ pub fn parse_block(&mut self) -> PResult<'a, P<Block>> {
                 );
             }
             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(),
index 552619dd4beecfcfc4d2d79a426cb6e57e411f49..22845775aed13c13c1582d2c966d81b51f32da61 100644 (file)
@@ -2,7 +2,7 @@ error: expected `{`, found `and`
   --> $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
 
@@ -10,7 +10,7 @@ error: expected `{`, found `or`
   --> $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
 
@@ -21,7 +21,7 @@ LL |     if (a and b) {
    |           ^^^
    |           |
    |           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
@@ -30,7 +30,7 @@ LL |     if (a or b) {
    |           ^^
    |           |
    |           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
@@ -39,7 +39,7 @@ LL |     while a and b {
    |             ^^^
    |             |
    |             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
@@ -48,7 +48,7 @@ LL |     while a or b {
    |             ^^
    |             |
    |             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