diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-03-25 15:36:59 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-03-25 15:36:59 -0700 |
| commit | 78ae8feebbf9a2c70d42780d0c646cbbc1f2cdbc (patch) | |
| tree | 6280f6af76d15fd058ac2175a83c12a70212b496 /src/test/parse-fail | |
| parent | 03eca713816ee00ecacde27cc655dc199c6bff40 (diff) | |
| download | rust-78ae8feebbf9a2c70d42780d0c646cbbc1f2cdbc.tar.gz rust-78ae8feebbf9a2c70d42780d0c646cbbc1f2cdbc.zip | |
Improve wording and spans for unexpected token
* Point at where the token was expected instead of the last token successfuly parsed. * Only show `unexpected token` if the next char and the unexpected token don't have the same span. * Change some cfail and pfail tests to ui test. * Don't show all possible tokens in span label if they are more than 6.
Diffstat (limited to 'src/test/parse-fail')
| -rw-r--r-- | src/test/parse-fail/bounds-obj-parens.rs | 17 | ||||
| -rw-r--r-- | src/test/parse-fail/match-refactor-to-expr.rs | 2 | ||||
| -rw-r--r-- | src/test/parse-fail/trailing-plus-in-bounds.rs | 21 |
3 files changed, 1 insertions, 39 deletions
diff --git a/src/test/parse-fail/bounds-obj-parens.rs b/src/test/parse-fail/bounds-obj-parens.rs deleted file mode 100644 index 02c119cf727..00000000000 --- a/src/test/parse-fail/bounds-obj-parens.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only - -type A = Box<(Fn(D::Error) -> E) + 'static + Send + Sync>; // OK (but see #39318) - -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 7bb1c40118a..e2fee1d1895 100644 --- a/src/test/parse-fail/match-refactor-to-expr.rs +++ b/src/test/parse-fail/match-refactor-to-expr.rs @@ -14,7 +14,7 @@ fn main() { let foo = match //~ NOTE did you mean to remove this `match` keyword? Some(4).unwrap_or_else(5) - //~^ NOTE expected one of `.`, `?`, `{`, or an operator after this + //~^ NOTE expected one of `.`, `?`, `{`, or an operator here ; //~ NOTE unexpected token //~^ ERROR expected one of `.`, `?`, `{`, or an operator, found `;` diff --git a/src/test/parse-fail/trailing-plus-in-bounds.rs b/src/test/parse-fail/trailing-plus-in-bounds.rs deleted file mode 100644 index 2bb2c97790c..00000000000 --- a/src/test/parse-fail/trailing-plus-in-bounds.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// compile-flags: -Z parse-only -Z continue-parse-after-error - -use std::fmt::Debug; - -fn main() { - let x: Box<Debug+> = box 3 as Box<Debug+>; // Trailing `+` is OK -} - -FAIL -//~^ ERROR -//~| ERROR |
