Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Continue evaluating after type argument in where clause
  • Loading branch information
estebank committed Jan 12, 2019
1 parent 5d2f31c commit 57f17e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/libsyntax/parse/parser.rs
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions 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() {}
11 changes: 9 additions & 2 deletions src/test/ui/parser/where_with_bound.stderr
Expand Up @@ -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`.

0 comments on commit 57f17e9

Please sign in to comment.