diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-02-10 17:29:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-10 17:29:03 +0100 |
| commit | 119bc976db5549f17258a55bb9684eae0fa98b65 (patch) | |
| tree | c86a4ca7da09a17b2eaafb29547bcd7c938fb59d /src/test | |
| parent | db08784964012fc998b33f4104daf05a121383e0 (diff) | |
| parent | 371060b5988158fdaa3b7abd6167a28d95d74b38 (diff) | |
| download | rust-119bc976db5549f17258a55bb9684eae0fa98b65.tar.gz rust-119bc976db5549f17258a55bb9684eae0fa98b65.zip | |
Rollup merge of #69014 - dwrensha:fix-68890, r=Centril
change an instance of span_bug() to struct_span_err() to avoid ICE After #67148, the `span_bug()` in `parse_ty_tuple_or_parens()` is reachable because `parse_paren_comma_seq()` can return an `Ok()` even in cases where it encounters an error. This pull request prevents an ICE in such cases by replacing the `span_bug()` with `struct_span_error()`. Fixes #68890.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/parser/issue-68890.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-68890.stderr | 20 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/parser/issue-68890.rs b/src/test/ui/parser/issue-68890.rs new file mode 100644 index 00000000000..a7c5a5e1300 --- /dev/null +++ b/src/test/ui/parser/issue-68890.rs @@ -0,0 +1,4 @@ +enum e{A((?'a a+?+l))} +//~^ ERROR `?` may only modify trait bounds, not lifetime bounds +//~| ERROR expected one of `)`, `+`, or `,` +//~| ERROR expected trait bound, not lifetime bound diff --git a/src/test/ui/parser/issue-68890.stderr b/src/test/ui/parser/issue-68890.stderr new file mode 100644 index 00000000000..9bb8761b67b --- /dev/null +++ b/src/test/ui/parser/issue-68890.stderr @@ -0,0 +1,20 @@ +error: `?` may only modify trait bounds, not lifetime bounds + --> $DIR/issue-68890.rs:1:11 + | +LL | enum e{A((?'a a+?+l))} + | ^ + +error: expected one of `)`, `+`, or `,`, found `a` + --> $DIR/issue-68890.rs:1:15 + | +LL | enum e{A((?'a a+?+l))} + | ^ expected one of `)`, `+`, or `,` + +error: expected trait bound, not lifetime bound + --> $DIR/issue-68890.rs:1:11 + | +LL | enum e{A((?'a a+?+l))} + | ^^^ + +error: aborting due to 3 previous errors + |
