Add support for new where clause location in associated types.

A recent Rust nightly changed it: https://github.com/rust-lang/rust/issues/89122

This allows both the old and new location.
This commit is contained in:
Dario Nieuwenhuis 2022-03-10 18:10:03 +01:00
parent 356c507357
commit 49d1207775
5 changed files with 47 additions and 8 deletions

View file

@ -290,12 +290,17 @@ fn type_alias(p: &mut Parser, m: Marker) {
generic_params::bounds(p);
}
// test type_item_where_clause
// test type_item_where_clause_deprecated
// type Foo where Foo: Copy = ();
generic_params::opt_where_clause(p);
if p.eat(T![=]) {
types::type_(p);
}
// test type_item_where_clause
// type Foo = () where Foo: Copy;
generic_params::opt_where_clause(p);
p.expect(T![;]);
m.complete(p, TYPE_ALIAS);
}