diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-10-23 22:20:58 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-10-24 12:26:01 -0700 |
| commit | 0baf61bfdb95980c69fbfcc0fc95ce82e8d81ac9 (patch) | |
| tree | 83a1e3a9b3ce6bdf5e87d47d5a79c5e033096519 /src/test/ui/parser | |
| parent | 4a8c5b20c7772bc5342b83d4b0696ea216ef75a7 (diff) | |
| download | rust-0baf61bfdb95980c69fbfcc0fc95ce82e8d81ac9.tar.gz rust-0baf61bfdb95980c69fbfcc0fc95ce82e8d81ac9.zip | |
Increase spacing for suggestions in diagnostics
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
Diffstat (limited to 'src/test/ui/parser')
59 files changed, 75 insertions, 0 deletions
diff --git a/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr index ada0f268a8d..7d0bb0965b6 100644 --- a/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr +++ b/src/test/ui/parser/associated-types-project-from-hrtb-explicit.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `for` | LL | fn foo2<I>(x: <I as for<'x> Foo<&'x isize>>::A) | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | fn foo2<I>(x: <I as r#for<'x> Foo<&'x isize>>::A) diff --git a/src/test/ui/parser/bad-value-ident-false.stderr b/src/test/ui/parser/bad-value-ident-false.stderr index 9ddca101567..b59ea97e3b1 100644 --- a/src/test/ui/parser/bad-value-ident-false.stderr +++ b/src/test/ui/parser/bad-value-ident-false.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `false` | LL | fn false() { } | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | fn r#false() { } diff --git a/src/test/ui/parser/bad-value-ident-true.stderr b/src/test/ui/parser/bad-value-ident-true.stderr index ec497dbe407..12132b0856b 100644 --- a/src/test/ui/parser/bad-value-ident-true.stderr +++ b/src/test/ui/parser/bad-value-ident-true.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `true` | LL | fn true() { } | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | fn r#true() { } diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr index a11209998a7..4dcc914f25d 100644 --- a/src/test/ui/parser/expr-as-stmt.stderr +++ b/src/test/ui/parser/expr-as-stmt.stderr @@ -35,6 +35,7 @@ error: expected expression, found `>` | LL | } > 0 | ^ expected expression + | help: parentheses are required to parse this as an expression | LL | (match x { diff --git a/src/test/ui/parser/issue-15980.stderr b/src/test/ui/parser/issue-15980.stderr index 879bcb2b4a1..47c275110b4 100644 --- a/src/test/ui/parser/issue-15980.stderr +++ b/src/test/ui/parser/issue-15980.stderr @@ -6,6 +6,7 @@ LL | Err(ref e) if e.kind == io::EndOfFile { LL | LL | return | ^^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | r#return diff --git a/src/test/ui/parser/issue-33418.stderr b/src/test/ui/parser/issue-33418.stderr index 660d9fd30c8..479e7bed101 100644 --- a/src/test/ui/parser/issue-33418.stderr +++ b/src/test/ui/parser/issue-33418.stderr @@ -3,6 +3,7 @@ error: negative trait bounds are not supported | LL | trait Tr: !SuperA {} | ^^^^^^^^^ negative trait bounds are not supported + | = help: remove the trait bound error: negative trait bounds are not supported @@ -10,6 +11,7 @@ error: negative trait bounds are not supported | LL | trait Tr2: SuperA + !SuperB {} | ^^^^^^^^^ negative trait bounds are not supported + | = help: remove the trait bound error: negative trait bounds are not supported @@ -17,6 +19,7 @@ error: negative trait bounds are not supported | LL | trait Tr3: !SuperA + SuperB {} | ^^^^^^^^^ negative trait bounds are not supported + | = help: remove the trait bound error: negative trait bounds are not supported @@ -26,6 +29,7 @@ LL | trait Tr4: !SuperA + SuperB | ^^^^^^^^^ LL | + !SuperC + SuperD {} | ^^^^^^^^^ negative trait bounds are not supported + | = help: remove the trait bounds error: negative trait bounds are not supported @@ -35,6 +39,7 @@ LL | trait Tr5: !SuperA | ^^^^^^^^^ LL | + !SuperB {} | ^^^^^^^^^ negative trait bounds are not supported + | = help: remove the trait bounds error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/issue-62895.stderr b/src/test/ui/parser/issue-62895.stderr index 39ce980964b..14869e9c8f5 100644 --- a/src/test/ui/parser/issue-62895.stderr +++ b/src/test/ui/parser/issue-62895.stderr @@ -15,6 +15,7 @@ error: missing `fn` for function definition | LL | pub g() -> is | ^^^^ + | help: add `fn` here to parse `g` as a public function | LL | pub fn g() -> is diff --git a/src/test/ui/parser/issue-62973.stderr b/src/test/ui/parser/issue-62973.stderr index 141076bf6b6..e73776dc7b4 100644 --- a/src/test/ui/parser/issue-62973.stderr +++ b/src/test/ui/parser/issue-62973.stderr @@ -25,6 +25,7 @@ LL | fn p() { match s { v, E { [) {) } LL | | LL | | | |_^ + | help: surround the struct literal with parentheses | LL | fn p() { match (s { v, E { [) {) } diff --git a/src/test/ui/parser/keyword-abstract.stderr b/src/test/ui/parser/keyword-abstract.stderr index eb2c810099e..b355b3a708d 100644 --- a/src/test/ui/parser/keyword-abstract.stderr +++ b/src/test/ui/parser/keyword-abstract.stderr @@ -3,6 +3,7 @@ error: expected identifier, found reserved keyword `abstract` | LL | let abstract = (); | ^^^^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#abstract = (); diff --git a/src/test/ui/parser/keyword-as-as-identifier.stderr b/src/test/ui/parser/keyword-as-as-identifier.stderr index 5648652be9b..dea4afd5c0a 100644 --- a/src/test/ui/parser/keyword-as-as-identifier.stderr +++ b/src/test/ui/parser/keyword-as-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `as` | LL | let as = "foo"; | ^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#as = "foo"; diff --git a/src/test/ui/parser/keyword-break-as-identifier.stderr b/src/test/ui/parser/keyword-break-as-identifier.stderr index 820193db70b..db05f3956a2 100644 --- a/src/test/ui/parser/keyword-break-as-identifier.stderr +++ b/src/test/ui/parser/keyword-break-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `break` | LL | let break = "foo"; | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#break = "foo"; diff --git a/src/test/ui/parser/keyword-const-as-identifier.stderr b/src/test/ui/parser/keyword-const-as-identifier.stderr index 95b536c99c7..45c129960ec 100644 --- a/src/test/ui/parser/keyword-const-as-identifier.stderr +++ b/src/test/ui/parser/keyword-const-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `const` | LL | let const = "foo"; | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#const = "foo"; diff --git a/src/test/ui/parser/keyword-continue-as-identifier.stderr b/src/test/ui/parser/keyword-continue-as-identifier.stderr index 6b24422a555..2ec4b28c94e 100644 --- a/src/test/ui/parser/keyword-continue-as-identifier.stderr +++ b/src/test/ui/parser/keyword-continue-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `continue` | LL | let continue = "foo"; | ^^^^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#continue = "foo"; diff --git a/src/test/ui/parser/keyword-else-as-identifier.stderr b/src/test/ui/parser/keyword-else-as-identifier.stderr index f28635cd08c..b622806e916 100644 --- a/src/test/ui/parser/keyword-else-as-identifier.stderr +++ b/src/test/ui/parser/keyword-else-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `else` | LL | let else = "foo"; | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#else = "foo"; diff --git a/src/test/ui/parser/keyword-enum-as-identifier.stderr b/src/test/ui/parser/keyword-enum-as-identifier.stderr index fc54dce1b68..0f3fa3fb624 100644 --- a/src/test/ui/parser/keyword-enum-as-identifier.stderr +++ b/src/test/ui/parser/keyword-enum-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `enum` | LL | let enum = "foo"; | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#enum = "foo"; diff --git a/src/test/ui/parser/keyword-final.stderr b/src/test/ui/parser/keyword-final.stderr index 291710d05cb..c74e3101729 100644 --- a/src/test/ui/parser/keyword-final.stderr +++ b/src/test/ui/parser/keyword-final.stderr @@ -3,6 +3,7 @@ error: expected identifier, found reserved keyword `final` | LL | let final = (); | ^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#final = (); diff --git a/src/test/ui/parser/keyword-fn-as-identifier.stderr b/src/test/ui/parser/keyword-fn-as-identifier.stderr index 692f195b288..3219eaf24f9 100644 --- a/src/test/ui/parser/keyword-fn-as-identifier.stderr +++ b/src/test/ui/parser/keyword-fn-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `fn` | LL | let fn = "foo"; | ^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#fn = "foo"; diff --git a/src/test/ui/parser/keyword-for-as-identifier.stderr b/src/test/ui/parser/keyword-for-as-identifier.stderr index bcaf421286e..30974af7424 100644 --- a/src/test/ui/parser/keyword-for-as-identifier.stderr +++ b/src/test/ui/parser/keyword-for-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `for` | LL | let for = "foo"; | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#for = "foo"; diff --git a/src/test/ui/parser/keyword-if-as-identifier.stderr b/src/test/ui/parser/keyword-if-as-identifier.stderr index 43fbcd7148a..a72030befb3 100644 --- a/src/test/ui/parser/keyword-if-as-identifier.stderr +++ b/src/test/ui/parser/keyword-if-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `if` | LL | let if = "foo"; | ^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#if = "foo"; diff --git a/src/test/ui/parser/keyword-impl-as-identifier.stderr b/src/test/ui/parser/keyword-impl-as-identifier.stderr index 01886eb45cb..e51c60ed494 100644 --- a/src/test/ui/parser/keyword-impl-as-identifier.stderr +++ b/src/test/ui/parser/keyword-impl-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `impl` | LL | let impl = "foo"; | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#impl = "foo"; diff --git a/src/test/ui/parser/keyword-let-as-identifier.stderr b/src/test/ui/parser/keyword-let-as-identifier.stderr index f6c39077be2..d580b451809 100644 --- a/src/test/ui/parser/keyword-let-as-identifier.stderr +++ b/src/test/ui/parser/keyword-let-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `let` | LL | let let = "foo"; | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#let = "foo"; diff --git a/src/test/ui/parser/keyword-loop-as-identifier.stderr b/src/test/ui/parser/keyword-loop-as-identifier.stderr index f0c282faa29..15c008da353 100644 --- a/src/test/ui/parser/keyword-loop-as-identifier.stderr +++ b/src/test/ui/parser/keyword-loop-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `loop` | LL | let loop = "foo"; | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#loop = "foo"; diff --git a/src/test/ui/parser/keyword-match-as-identifier.stderr b/src/test/ui/parser/keyword-match-as-identifier.stderr index f1f4397d194..5ba63965c87 100644 --- a/src/test/ui/parser/keyword-match-as-identifier.stderr +++ b/src/test/ui/parser/keyword-match-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `match` | LL | let match = "foo"; | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#match = "foo"; diff --git a/src/test/ui/parser/keyword-mod-as-identifier.stderr b/src/test/ui/parser/keyword-mod-as-identifier.stderr index 65ae3baa8c2..7fb1bda3fb0 100644 --- a/src/test/ui/parser/keyword-mod-as-identifier.stderr +++ b/src/test/ui/parser/keyword-mod-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `mod` | LL | let mod = "foo"; | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#mod = "foo"; diff --git a/src/test/ui/parser/keyword-move-as-identifier.stderr b/src/test/ui/parser/keyword-move-as-identifier.stderr index 216f7c931ee..9721c88cb16 100644 --- a/src/test/ui/parser/keyword-move-as-identifier.stderr +++ b/src/test/ui/parser/keyword-move-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `move` | LL | let move = "foo"; | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#move = "foo"; diff --git a/src/test/ui/parser/keyword-override.stderr b/src/test/ui/parser/keyword-override.stderr index 3183fa510c2..8bbc6fc6547 100644 --- a/src/test/ui/parser/keyword-override.stderr +++ b/src/test/ui/parser/keyword-override.stderr @@ -3,6 +3,7 @@ error: expected identifier, found reserved keyword `override` | LL | let override = (); | ^^^^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#override = (); diff --git a/src/test/ui/parser/keyword-pub-as-identifier.stderr b/src/test/ui/parser/keyword-pub-as-identifier.stderr index f81078b12bd..10ff53e2916 100644 --- a/src/test/ui/parser/keyword-pub-as-identifier.stderr +++ b/src/test/ui/parser/keyword-pub-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `pub` | LL | let pub = "foo"; | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#pub = "foo"; diff --git a/src/test/ui/parser/keyword-return-as-identifier.stderr b/src/test/ui/parser/keyword-return-as-identifier.stderr index 8cc4d12fbbb..5b5f2b7ed54 100644 --- a/src/test/ui/parser/keyword-return-as-identifier.stderr +++ b/src/test/ui/parser/keyword-return-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `return` | LL | let return = "foo"; | ^^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#return = "foo"; diff --git a/src/test/ui/parser/keyword-static-as-identifier.stderr b/src/test/ui/parser/keyword-static-as-identifier.stderr index 7d22bc97d66..81aeb9e37ab 100644 --- a/src/test/ui/parser/keyword-static-as-identifier.stderr +++ b/src/test/ui/parser/keyword-static-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `static` | LL | let static = "foo"; | ^^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#static = "foo"; diff --git a/src/test/ui/parser/keyword-struct-as-identifier.stderr b/src/test/ui/parser/keyword-struct-as-identifier.stderr index b109fa6247d..1b287b60197 100644 --- a/src/test/ui/parser/keyword-struct-as-identifier.stderr +++ b/src/test/ui/parser/keyword-struct-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `struct` | LL | let struct = "foo"; | ^^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#struct = "foo"; diff --git a/src/test/ui/parser/keyword-trait-as-identifier.stderr b/src/test/ui/parser/keyword-trait-as-identifier.stderr index ccc675cdb3a..c3d4d61dbb7 100644 --- a/src/test/ui/parser/keyword-trait-as-identifier.stderr +++ b/src/test/ui/parser/keyword-trait-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `trait` | LL | let trait = "foo"; | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#trait = "foo"; diff --git a/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr b/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr index f71b889a30d..fcd717d6e67 100644 --- a/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr +++ b/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr @@ -3,6 +3,7 @@ error: expected identifier, found reserved keyword `try` | LL | let try = "foo"; | ^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#try = "foo"; diff --git a/src/test/ui/parser/keyword-type-as-identifier.stderr b/src/test/ui/parser/keyword-type-as-identifier.stderr index 88099d949a8..dfe1958e78f 100644 --- a/src/test/ui/parser/keyword-type-as-identifier.stderr +++ b/src/test/ui/parser/keyword-type-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `type` | LL | let type = "foo"; | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#type = "foo"; diff --git a/src/test/ui/parser/keyword-typeof.stderr b/src/test/ui/parser/keyword-typeof.stderr index 4a1b63d5c93..7cef6de0cee 100644 --- a/src/test/ui/parser/keyword-typeof.stderr +++ b/src/test/ui/parser/keyword-typeof.stderr @@ -3,6 +3,7 @@ error: expected identifier, found reserved keyword `typeof` | LL | let typeof = (); | ^^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#typeof = (); diff --git a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr index 205bb81df40..d714a99dac4 100644 --- a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr +++ b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `unsafe` | LL | let unsafe = "foo"; | ^^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#unsafe = "foo"; diff --git a/src/test/ui/parser/keyword-use-as-identifier.stderr b/src/test/ui/parser/keyword-use-as-identifier.stderr index 85a0492f573..30a6c5b16a3 100644 --- a/src/test/ui/parser/keyword-use-as-identifier.stderr +++ b/src/test/ui/parser/keyword-use-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `use` | LL | let use = "foo"; | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#use = "foo"; diff --git a/src/test/ui/parser/keyword-where-as-identifier.stderr b/src/test/ui/parser/keyword-where-as-identifier.stderr index b8b85069076..38d734ab812 100644 --- a/src/test/ui/parser/keyword-where-as-identifier.stderr +++ b/src/test/ui/parser/keyword-where-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `where` | LL | let where = "foo"; | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#where = "foo"; diff --git a/src/test/ui/parser/keyword-while-as-identifier.stderr b/src/test/ui/parser/keyword-while-as-identifier.stderr index bb0c0ac668a..22b5454add8 100644 --- a/src/test/ui/parser/keyword-while-as-identifier.stderr +++ b/src/test/ui/parser/keyword-while-as-identifier.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `while` | LL | let while = "foo"; | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let r#while = "foo"; diff --git a/src/test/ui/parser/keyword.stderr b/src/test/ui/parser/keyword.stderr index 262467b6907..c179f4ec560 100644 --- a/src/test/ui/parser/keyword.stderr +++ b/src/test/ui/parser/keyword.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `break` | LL | pub mod break { | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | pub mod r#break { diff --git a/src/test/ui/parser/lex-bad-char-literals-2.stderr b/src/test/ui/parser/lex-bad-char-literals-2.stderr index 5653d4ea672..3a545ee2826 100644 --- a/src/test/ui/parser/lex-bad-char-literals-2.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-2.stderr @@ -3,6 +3,7 @@ error: character literal may only contain one codepoint | LL | 'nope' | ^^^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | "nope" diff --git a/src/test/ui/parser/lex-bad-char-literals-3.stderr b/src/test/ui/parser/lex-bad-char-literals-3.stderr index 6462a3c0e57..ec661ee2a60 100644 --- a/src/test/ui/parser/lex-bad-char-literals-3.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-3.stderr @@ -3,6 +3,7 @@ error: character literal may only contain one codepoint | LL | static c: char = '●●'; | ^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | static c: char = "●●"; @@ -13,6 +14,7 @@ error: character literal may only contain one codepoint | LL | let ch: &str = '●●'; | ^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | let ch: &str = "●●"; diff --git a/src/test/ui/parser/lex-bad-char-literals-5.stderr b/src/test/ui/parser/lex-bad-char-literals-5.stderr index 97c6338820d..334165a962a 100644 --- a/src/test/ui/parser/lex-bad-char-literals-5.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-5.stderr @@ -3,6 +3,7 @@ error: character literal may only contain one codepoint | LL | static c: char = '\x10\x10'; | ^^^^^^^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | static c: char = "\x10\x10"; @@ -13,6 +14,7 @@ error: character literal may only contain one codepoint | LL | let ch: &str = '\x10\x10'; | ^^^^^^^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | let ch: &str = "\x10\x10"; diff --git a/src/test/ui/parser/lex-bad-char-literals-6.stderr b/src/test/ui/parser/lex-bad-char-literals-6.stderr index a7bbe05e94b..662cf2657e7 100644 --- a/src/test/ui/parser/lex-bad-char-literals-6.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-6.stderr @@ -3,6 +3,7 @@ error: character literal may only contain one codepoint | LL | let x: &str = 'ab'; | ^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | let x: &str = "ab"; @@ -13,6 +14,7 @@ error: character literal may only contain one codepoint | LL | let y: char = 'cd'; | ^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | let y: char = "cd"; @@ -23,6 +25,7 @@ error: character literal may only contain one codepoint | LL | let z = 'ef'; | ^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | let z = "ef"; diff --git a/src/test/ui/parser/macro-keyword.stderr b/src/test/ui/parser/macro-keyword.stderr index f74c8aa57e7..9fe95c3fd3d 100644 --- a/src/test/ui/parser/macro-keyword.stderr +++ b/src/test/ui/parser/macro-keyword.stderr @@ -3,6 +3,7 @@ error: expected identifier, found reserved keyword `macro` | LL | fn macro() { | ^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | fn r#macro() { diff --git a/src/test/ui/parser/macros-no-semicolon-items.stderr b/src/test/ui/parser/macros-no-semicolon-items.stderr index 5276aa6f5e9..980ceeed8c6 100644 --- a/src/test/ui/parser/macros-no-semicolon-items.stderr +++ b/src/test/ui/parser/macros-no-semicolon-items.stderr @@ -3,6 +3,7 @@ error: macros that expand to items must be delimited with braces or followed by | LL | macro_rules! foo() | ^^ + | help: change the delimiters to curly braces | LL | macro_rules! foo {} @@ -22,6 +23,7 @@ LL | | blah LL | | blah LL | | ) | |_^ + | help: change the delimiters to curly braces | LL | bar! { diff --git a/src/test/ui/parser/match-arrows-block-then-binop.stderr b/src/test/ui/parser/match-arrows-block-then-binop.stderr index bb7df30783a..3bc451e84e6 100644 --- a/src/test/ui/parser/match-arrows-block-then-binop.stderr +++ b/src/test/ui/parser/match-arrows-block-then-binop.stderr @@ -3,6 +3,7 @@ error: expected pattern, found `+` | LL | } + 5 | ^ expected pattern + | help: parentheses are required to parse this as an expression | LL | 0 => ({ diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr index b1cf99189f1..a0e290a834d 100644 --- a/src/test/ui/parser/mut-patterns.stderr +++ b/src/test/ui/parser/mut-patterns.stderr @@ -47,6 +47,7 @@ error: expected identifier, found reserved keyword `yield` | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let mut mut r#yield(become, await) = r#yield(0, 0); @@ -57,6 +58,7 @@ error: expected identifier, found reserved keyword `become` | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^^ expected identifier, found reserved keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let mut mut yield(r#become, await) = r#yield(0, 0); @@ -67,6 +69,7 @@ error: expected identifier, found keyword `await` | LL | let mut mut yield(become, await) = r#yield(0, 0); | ^^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | let mut mut yield(become, r#await) = r#yield(0, 0); diff --git a/src/test/ui/parser/range_inclusive_dotdotdot.stderr b/src/test/ui/parser/range_inclusive_dotdotdot.stderr index f877c5c6f79..f129e1e372f 100644 --- a/src/test/ui/parser/range_inclusive_dotdotdot.stderr +++ b/src/test/ui/parser/range_inclusive_dotdotdot.stderr @@ -3,6 +3,7 @@ error: unexpected token: `...` | LL | return ...1; | ^^^ + | help: use `..` for an exclusive range | LL | return ..1; @@ -17,6 +18,7 @@ error: unexpected token: `...` | LL | let x = ...0; | ^^^ + | help: use `..` for an exclusive range | LL | let x = ..0; @@ -31,6 +33,7 @@ error: unexpected token: `...` | LL | let x = 5...5; | ^^^ + | help: use `..` for an exclusive range | LL | let x = 5..5; @@ -45,6 +48,7 @@ error: unexpected token: `...` | LL | for _ in 0...1 {} | ^^^ + | help: use `..` for an exclusive range | LL | for _ in 0..1 {} diff --git a/src/test/ui/parser/recover-from-homoglyph.stderr b/src/test/ui/parser/recover-from-homoglyph.stderr index 424d492b7ba..ec7d041647a 100644 --- a/src/test/ui/parser/recover-from-homoglyph.stderr +++ b/src/test/ui/parser/recover-from-homoglyph.stderr @@ -3,6 +3,7 @@ error: unknown start of token: \u{37e} | LL | println!(""); | ^ + | help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not | LL | println!(""); diff --git a/src/test/ui/parser/removed-syntax-field-let.stderr b/src/test/ui/parser/removed-syntax-field-let.stderr index d6e38be4869..0d15151b7d4 100644 --- a/src/test/ui/parser/removed-syntax-field-let.stderr +++ b/src/test/ui/parser/removed-syntax-field-let.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `let` | LL | let foo: (), | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | r#let foo: (), diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr index 5aa37a40cbd..85478dcd1dc 100644 --- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr +++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr @@ -15,6 +15,7 @@ error: chained comparison operators require parentheses | LL | f<X>(); | ^^^ + | help: use `::<...>` instead of `<...>` to specify type arguments | LL | f::<X>(); @@ -25,6 +26,7 @@ error: chained comparison operators require parentheses | LL | f<Result<Option<X>, Option<Option<X>>>(1, 2); | ^^^^^^^^ + | help: use `::<...>` instead of `<...>` to specify type arguments | LL | f::<Result<Option<X>, Option<Option<X>>>(1, 2); diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr index 29af72a5d23..2e59914864a 100644 --- a/src/test/ui/parser/struct-literal-in-for.stderr +++ b/src/test/ui/parser/struct-literal-in-for.stderr @@ -6,6 +6,7 @@ LL | for x in Foo { LL | | x: 3 LL | | }.hi() { | |_____^ + | help: surround the struct literal with parentheses | LL | for x in (Foo { diff --git a/src/test/ui/parser/struct-literal-in-if.stderr b/src/test/ui/parser/struct-literal-in-if.stderr index e76c1cb45dd..7a64a42e3c8 100644 --- a/src/test/ui/parser/struct-literal-in-if.stderr +++ b/src/test/ui/parser/struct-literal-in-if.stderr @@ -6,6 +6,7 @@ LL | if Foo { LL | | x: 3 LL | | }.hi() { | |_____^ + | help: surround the struct literal with parentheses | LL | if (Foo { diff --git a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr index 95b0882b7ae..98077761e01 100644 --- a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr +++ b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr @@ -6,6 +6,7 @@ LL | match Foo { LL | | x: 3 LL | | } { | |_____^ + | help: surround the struct literal with parentheses | LL | match (Foo { diff --git a/src/test/ui/parser/struct-literal-in-while.stderr b/src/test/ui/parser/struct-literal-in-while.stderr index acd31b477dc..a14df3a220e 100644 --- a/src/test/ui/parser/struct-literal-in-while.stderr +++ b/src/test/ui/parser/struct-literal-in-while.stderr @@ -6,6 +6,7 @@ LL | while Foo { LL | | x: 3 LL | | }.hi() { | |_____^ + | help: surround the struct literal with parentheses | LL | while (Foo { diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr index 24078074161..38f4a986e12 100644 --- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr @@ -6,6 +6,7 @@ LL | while || Foo { LL | | x: 3 LL | | }.hi() { | |_____^ + | help: surround the struct literal with parentheses | LL | while || (Foo { diff --git a/src/test/ui/parser/unicode-chars.stderr b/src/test/ui/parser/unicode-chars.stderr index 76bf6627a4b..4e14eda8f2b 100644 --- a/src/test/ui/parser/unicode-chars.stderr +++ b/src/test/ui/parser/unicode-chars.stderr @@ -3,6 +3,7 @@ error: unknown start of token: \u{37e} | LL | let y = 0; | ^ + | help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not | LL | let y = 0; diff --git a/src/test/ui/parser/unicode-quote-chars.stderr b/src/test/ui/parser/unicode-quote-chars.stderr index 84e45ecd873..4b0cb96ed21 100644 --- a/src/test/ui/parser/unicode-quote-chars.stderr +++ b/src/test/ui/parser/unicode-quote-chars.stderr @@ -3,6 +3,7 @@ error: unknown start of token: \u{201c} | LL | println!(“hello world”); | ^ + | help: Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '"' (Quotation Mark), but are not | LL | println!("hello world"); @@ -13,6 +14,7 @@ error: unknown start of token: \u{201d} | LL | println!(“hello world”); | ^ + | help: Unicode character '”' (Right Double Quotation Mark) looks like '"' (Quotation Mark), but it is not | LL | println!(“hello world"); diff --git a/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr index 07644002543..c73e17d2fc9 100644 --- a/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr +++ b/src/test/ui/parser/use-as-where-use-ends-with-mod-sep.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `as` | LL | use std::any:: as foo; | ^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | use std::any:: r#as foo; |
