diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-01-17 21:18:29 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2017-01-24 22:56:02 +0300 |
| commit | b795abeb1dc0f6d27e49d980a48936b687754b28 (patch) | |
| tree | 9ff19f184b8c7063635179b62f2293aba8d04f34 /src/test/parse-fail | |
| parent | fe597dc9a9f325de9b2b11d69e190e1c22c4e7dc (diff) | |
| download | rust-b795abeb1dc0f6d27e49d980a48936b687754b28.tar.gz rust-b795abeb1dc0f6d27e49d980a48936b687754b28.zip | |
Refactor parsing of generic arguments/parameters and where clauses
Diffstat (limited to 'src/test/parse-fail')
| -rw-r--r-- | src/test/parse-fail/issue-14303-path.rs | 1 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-17904-2.rs (renamed from src/test/parse-fail/generic-non-trailing-defaults.rs) | 6 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-17904.rs | 3 | ||||
| -rw-r--r-- | src/test/parse-fail/issue-32214.rs | 5 | ||||
| -rw-r--r-- | src/test/parse-fail/lifetime-semicolon.rs | 3 | ||||
| -rw-r--r-- | src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs | 4 |
6 files changed, 7 insertions, 15 deletions
diff --git a/src/test/parse-fail/issue-14303-path.rs b/src/test/parse-fail/issue-14303-path.rs index 431a917c2d9..f0d1feffec8 100644 --- a/src/test/parse-fail/issue-14303-path.rs +++ b/src/test/parse-fail/issue-14303-path.rs @@ -12,4 +12,3 @@ fn bar<'a, T>(x: mymodule::X<'a, T, 'b, 'c>) {} //~^ ERROR lifetime parameters must be declared prior to type parameters -//~^^ ERROR expected pattern, found `'c` diff --git a/src/test/parse-fail/generic-non-trailing-defaults.rs b/src/test/parse-fail/issue-17904-2.rs index 2bb593258ae..3f41c0edd2e 100644 --- a/src/test/parse-fail/generic-non-trailing-defaults.rs +++ b/src/test/parse-fail/issue-17904-2.rs @@ -10,10 +10,6 @@ // compile-flags: -Z parse-only -Z continue-parse-after-error -struct Heap; - -struct Vec<A = Heap, T>; //~ ERROR type parameters with a default must be trailing - -struct Foo<A, B = Vec<C>, C>; //~ ERROR type parameters with a default must be trailing +struct Bar<T> { x: T } where T: Copy //~ ERROR expected item, found `where` fn main() {} diff --git a/src/test/parse-fail/issue-17904.rs b/src/test/parse-fail/issue-17904.rs index de5aeb02ab7..ae28ac76acb 100644 --- a/src/test/parse-fail/issue-17904.rs +++ b/src/test/parse-fail/issue-17904.rs @@ -13,7 +13,6 @@ struct Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax. struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well. struct Baz<U>(U) where U: Eq; // This rightfully signals no error as well. -struct Foo<T> where T: Copy, (T); //~ ERROR unexpected token in `where` clause -struct Bar<T> { x: T } where T: Copy //~ ERROR expected item, found `where` +struct Foo<T> where T: Copy, (T); //~ ERROR expected one of `+`, `:`, `==`, or `=`, found `;` fn main() {} diff --git a/src/test/parse-fail/issue-32214.rs b/src/test/parse-fail/issue-32214.rs index 3ba59c8ee94..9e200094093 100644 --- a/src/test/parse-fail/issue-32214.rs +++ b/src/test/parse-fail/issue-32214.rs @@ -10,8 +10,7 @@ // compile-flags: -Z parse-only -Z continue-parse-after-error -pub fn test<W, I: Iterator<Item=(), W> >() { - //~^ ERROR expected `=`, found `>` -} +pub fn test<W, I: Iterator<Item=(), W> >() {} +//~^ ERROR type parameters must be declared prior to associated type bindings fn main() { } diff --git a/src/test/parse-fail/lifetime-semicolon.rs b/src/test/parse-fail/lifetime-semicolon.rs index 7010d0e7deb..e1975952fca 100644 --- a/src/test/parse-fail/lifetime-semicolon.rs +++ b/src/test/parse-fail/lifetime-semicolon.rs @@ -15,5 +15,4 @@ struct Foo<'a, 'b> { } fn foo<'a, 'b>(x: &mut Foo<'a; 'b>) {} -//~^ ERROR expected `,` or `>` after lifetime name, found `;` -//~^^ NOTE did you mean a single argument type &'a Type, or did you mean the comma-separated +//~^ ERROR expected one of `,` or `>`, found `;` diff --git a/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs b/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs index 78d97454087..cf67b518fff 100644 --- a/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs +++ b/src/test/parse-fail/where-clauses-no-bounds-or-predicates.rs @@ -10,13 +10,13 @@ // compile-flags: -Z parse-only -Z continue-parse-after-error +// Empty predicate list is OK fn equal1<T>(_: &T, _: &T) -> bool where { -//~^ ERROR a `where` clause must have at least one predicate in it true } +// Empty bound list is OK fn equal2<T>(_: &T, _: &T) -> bool where T: { -//~^ ERROR each predicate in a `where` clause must have at least one bound true } |
