diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-01-11 21:05:18 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-01-11 21:05:48 -0800 |
| commit | 57f17e91d08b038a76e175bf2bbd36147d889eb0 (patch) | |
| tree | f6bcd9a5028cd8f5390d36b1509e18dbed66eceb | |
| parent | 5d2f31cddc4003c5c291641355191090f505c49a (diff) | |
| download | rust-57f17e91d08b038a76e175bf2bbd36147d889eb0.tar.gz rust-57f17e91d08b038a76e175bf2bbd36147d889eb0.zip | |
Continue evaluating after type argument in where clause
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/parser/where_with_bound.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/parser/where_with_bound.stderr | 11 |
3 files changed, 16 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index da910aefdc0..ce9db4d0468 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5393,8 +5393,12 @@ impl<'a> Parser<'a> { // change we parse those generics now, but report an error. if self.choose_generics_over_qpath() { let generics = self.parse_generics()?; - self.span_err(generics.span, - "generic parameters on `where` clauses are reserved for future use"); + self.struct_span_err( + generics.span, + "generic parameters on `where` clauses are reserved for future use", + ) + .span_label(generics.span, "currently unsupported") + .emit(); } loop { diff --git a/src/test/ui/parser/where_with_bound.rs b/src/test/ui/parser/where_with_bound.rs index 3a1edb9ffc9..3ca45f1889c 100644 --- a/src/test/ui/parser/where_with_bound.rs +++ b/src/test/ui/parser/where_with_bound.rs @@ -1,4 +1,5 @@ fn foo<T>() where <T>::Item: ToString, T: Iterator { } //~^ ERROR generic parameters on `where` clauses are reserved for future use +//~| ERROR cannot find type `Item` in the crate root fn main() {} diff --git a/src/test/ui/parser/where_with_bound.stderr b/src/test/ui/parser/where_with_bound.stderr index e68f7445558..ff98b3f5fed 100644 --- a/src/test/ui/parser/where_with_bound.stderr +++ b/src/test/ui/parser/where_with_bound.stderr @@ -2,7 +2,14 @@ error: generic parameters on `where` clauses are reserved for future use --> $DIR/where_with_bound.rs:1:19 | LL | fn foo<T>() where <T>::Item: ToString, T: Iterator { } - | ^^^ + | ^^^ currently unsupported -error: aborting due to previous error +error[E0412]: cannot find type `Item` in the crate root + --> $DIR/where_with_bound.rs:1:24 + | +LL | fn foo<T>() where <T>::Item: ToString, T: Iterator { } + | ^^^^ not found in the crate root + +error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0412`. |
