Continue evaluating after type argument in where clause
This commit is contained in:
parent
5d2f31cddc
commit
57f17e91d0
3 changed files with 16 additions and 4 deletions
|
@ -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 {
|
||||
|
|
|
@ -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() {}
|
||||
|
|
|
@ -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`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue