about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-03-24 19:14:58 -0700
committerEsteban Küber <esteban@kuber.com.ar>2017-03-24 23:37:25 -0700
commit03eca713816ee00ecacde27cc655dc199c6bff40 (patch)
tree43fbd80f7275db3d76bc4118b1a97c2c4e4597cd /src/test/parse-fail
parentc62e532f3de4c0254b772c36fe629b2042efd107 (diff)
downloadrust-03eca713816ee00ecacde27cc655dc199c6bff40.tar.gz
rust-03eca713816ee00ecacde27cc655dc199c6bff40.zip
Point at last valid token on failed `expect_one_of`
```rust
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
  --> $DIR/token-error-correct-3.rs:29:9
   |
25 |         foo()
   |             - expected one of `.`, `;`, `?`, `}`, or an operator after this
...
29 |     } else {
   |     ^ unexpected token
```
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/bounds-obj-parens.rs4
-rw-r--r--src/test/parse-fail/match-refactor-to-expr.rs4
-rw-r--r--src/test/parse-fail/trailing-plus-in-bounds.rs4
3 files changed, 9 insertions, 3 deletions
diff --git a/src/test/parse-fail/bounds-obj-parens.rs b/src/test/parse-fail/bounds-obj-parens.rs
index ad59d4a52d7..02c119cf727 100644
--- a/src/test/parse-fail/bounds-obj-parens.rs
+++ b/src/test/parse-fail/bounds-obj-parens.rs
@@ -12,4 +12,6 @@
 
 type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318)
 
-FAIL //~ ERROR
+FAIL
+//~^ ERROR
+//~| ERROR
diff --git a/src/test/parse-fail/match-refactor-to-expr.rs b/src/test/parse-fail/match-refactor-to-expr.rs
index 37b66601e70..7bb1c40118a 100644
--- a/src/test/parse-fail/match-refactor-to-expr.rs
+++ b/src/test/parse-fail/match-refactor-to-expr.rs
@@ -14,7 +14,9 @@ fn main() {
     let foo =
         match //~ NOTE did you mean to remove this `match` keyword?
         Some(4).unwrap_or_else(5)
-        ; //~ ERROR expected one of `.`, `?`, `{`, or an operator, found `;`
+        //~^ NOTE expected one of `.`, `?`, `{`, or an operator after this
+        ; //~ NOTE unexpected token
+        //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;`
 
     println!("{}", foo)
 }
diff --git a/src/test/parse-fail/trailing-plus-in-bounds.rs b/src/test/parse-fail/trailing-plus-in-bounds.rs
index 4a2e6d5bdcd..2bb2c97790c 100644
--- a/src/test/parse-fail/trailing-plus-in-bounds.rs
+++ b/src/test/parse-fail/trailing-plus-in-bounds.rs
@@ -16,4 +16,6 @@ fn main() {
     let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK
 }
 
-FAIL //~ ERROR
+FAIL
+//~^ ERROR
+//~| ERROR