diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-02-23 09:25:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-23 09:25:27 +0100 |
| commit | 18dd2d2fbe3cacc4bea71c0a7df831a62605a367 (patch) | |
| tree | 6b73118509c1cd32b994d127f14290d0047ec921 /src/test/ui/parser | |
| parent | 585d4d29d91065c14fb823b8044495a6e5e857c1 (diff) | |
| parent | 71cd4c8e4af4a05991fef5a61110510c78d90131 (diff) | |
Rollup merge of #58526 - pmccarter:master, r=estebank
Special suggestion for illegal unicode curly quote pairs Fixes #58436 Did not end up expanding the error message span to include the full string literal since I figured the start of the token was the issue, while the help suggestion span would include up to the closing quotation mark. The look ahead logic does not affect the reader position, not sure if that is an issue (if eg it should still continue to parse after the closing quote without erroring out).
Diffstat (limited to 'src/test/ui/parser')
| -rw-r--r-- | src/test/ui/parser/unicode-quote-chars.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/parser/unicode-quote-chars.stderr | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/parser/unicode-quote-chars.rs b/src/test/ui/parser/unicode-quote-chars.rs new file mode 100644 index 00000000000..69644211b8a --- /dev/null +++ b/src/test/ui/parser/unicode-quote-chars.rs @@ -0,0 +1,7 @@ +// ignore-tidy-linelength + +fn main() { + println!(“hello world”); + //~^ ERROR unknown start of token: \u{201c} + //~^^ HELP Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '"' (Quotation Mark), but are not +} diff --git a/src/test/ui/parser/unicode-quote-chars.stderr b/src/test/ui/parser/unicode-quote-chars.stderr new file mode 100644 index 00000000000..315e20cf854 --- /dev/null +++ b/src/test/ui/parser/unicode-quote-chars.stderr @@ -0,0 +1,12 @@ +error: unknown start of token: /u{201c} + --> $DIR/unicode-quote-chars.rs:4:14 + | +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"); + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + |
