diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-06 03:28:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-06 03:28:09 +0100 |
| commit | e5da1a12e745e0d92cfae421673faac4fd5e4069 (patch) | |
| tree | 7899e2184908bc21c9eb2b07698513ea1982030c /src/test | |
| parent | 5c4a595ff09d08c46ee3b23d343da47b0d12243d (diff) | |
| parent | 90f891d8ae9073623769fac18f00c4f1031fcb59 (diff) | |
Rollup merge of #66054 - petrochenkov:delspan, r=estebank
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes https://github.com/rust-lang/rust/issues/62524 r? @estebank
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/imports/import-prefix-macro-1.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-39848.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-62973.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-63135.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/parser/macro/macro-doc-comments-2.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/parser/missing_right_paren.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/parser/missing_right_paren.stderr | 17 |
7 files changed, 29 insertions, 9 deletions
diff --git a/src/test/ui/imports/import-prefix-macro-1.stderr b/src/test/ui/imports/import-prefix-macro-1.stderr index 577f1282471..862a31b4465 100644 --- a/src/test/ui/imports/import-prefix-macro-1.stderr +++ b/src/test/ui/imports/import-prefix-macro-1.stderr @@ -2,7 +2,7 @@ error: expected one of `::`, `;`, or `as`, found `{` --> $DIR/import-prefix-macro-1.rs:11:27 | LL | ($p: path) => (use $p {S, Z}); - | ^ expected one of `::`, `;`, or `as` here + | ^^^^^^ expected one of `::`, `;`, or `as` here ... LL | import! { a::b::c } | ------------------- in this macro invocation diff --git a/src/test/ui/issues/issue-39848.stderr b/src/test/ui/issues/issue-39848.stderr index fa87967432d..47aa8e17a30 100644 --- a/src/test/ui/issues/issue-39848.stderr +++ b/src/test/ui/issues/issue-39848.stderr @@ -2,7 +2,7 @@ error: expected `{`, found `foo` --> $DIR/issue-39848.rs:8:19 | LL | if $tgt.has_$field() {} - | -- - help: try placing this code inside a block: `{ ) }` + | -- -- help: try placing this code inside a block: `{ () }` | | | this `if` statement has a condition, but no block ... diff --git a/src/test/ui/parser/issue-62973.stderr b/src/test/ui/parser/issue-62973.stderr index 82122ef0b6f..f935d58c646 100644 --- a/src/test/ui/parser/issue-62973.stderr +++ b/src/test/ui/parser/issue-62973.stderr @@ -36,13 +36,13 @@ LL | ) | error: expected one of `.`, `?`, `{`, or an operator, found `}` - --> $DIR/issue-62973.rs:8:1 + --> $DIR/issue-62973.rs:8:2 | LL | fn p() { match s { v, E { [) {) } | ----- while parsing this match expression LL | LL | - | ^ expected one of `.`, `?`, `{`, or an operator here + | ^ expected one of `.`, `?`, `{`, or an operator here error: incorrect close delimiter: `)` --> $DIR/issue-62973.rs:6:28 diff --git a/src/test/ui/parser/issue-63135.stderr b/src/test/ui/parser/issue-63135.stderr index a077ad454a9..8e8087978a3 100644 --- a/src/test/ui/parser/issue-63135.stderr +++ b/src/test/ui/parser/issue-63135.stderr @@ -23,16 +23,16 @@ LL | fn i(n{...,f # | `..` must be at the end and cannot have a trailing comma error: expected `[`, found `}` - --> $DIR/issue-63135.rs:3:15 + --> $DIR/issue-63135.rs:3:16 | LL | fn i(n{...,f # - | ^ expected `[` + | ^ expected `[` error: expected one of `:` or `|`, found `)` - --> $DIR/issue-63135.rs:3:15 + --> $DIR/issue-63135.rs:3:16 | LL | fn i(n{...,f # - | ^ expected one of `:` or `|` here + | ^ expected one of `:` or `|` here error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/macro/macro-doc-comments-2.stderr b/src/test/ui/parser/macro/macro-doc-comments-2.stderr index 6abe95192be..023d1a3e039 100644 --- a/src/test/ui/parser/macro/macro-doc-comments-2.stderr +++ b/src/test/ui/parser/macro/macro-doc-comments-2.stderr @@ -5,7 +5,7 @@ LL | macro_rules! inner { | ------------------ when calling this macro ... LL | /// Outer - | ^ no rules expected this token in macro call + | ^^^^^^^^^ no rules expected this token in macro call error: aborting due to previous error diff --git a/src/test/ui/parser/missing_right_paren.rs b/src/test/ui/parser/missing_right_paren.rs new file mode 100644 index 00000000000..4f7c5eea1d1 --- /dev/null +++ b/src/test/ui/parser/missing_right_paren.rs @@ -0,0 +1,3 @@ +// ignore-tidy-trailing-newlines +// error-pattern: aborting due to 2 previous errors +fn main((ؼ \ No newline at end of file diff --git a/src/test/ui/parser/missing_right_paren.stderr b/src/test/ui/parser/missing_right_paren.stderr new file mode 100644 index 00000000000..fc75b031e76 --- /dev/null +++ b/src/test/ui/parser/missing_right_paren.stderr @@ -0,0 +1,17 @@ +error: this file contains an un-closed delimiter + --> $DIR/missing_right_paren.rs:3:11 + | +LL | fn main((ؼ + | -- ^ + | || + | |un-closed delimiter + | un-closed delimiter + +error: expected one of `:` or `|`, found `)` + --> $DIR/missing_right_paren.rs:3:11 + | +LL | fn main((ؼ + | ^ expected one of `:` or `|` here + +error: aborting due to 2 previous errors + |
