Fix where clauses using fully qualified path syntax

This commit is contained in:
DJMcNab 2018-12-21 17:20:38 +00:00
parent e086cc8db5
commit bd5a358910
5 changed files with 139 additions and 9 deletions

View file

@ -96,6 +96,7 @@ pub(super) fn bounds_without_colon(p: &mut Parser) {
// 'a: 'b + 'c,
// T: Clone + Copy + 'static,
// Iterator::Item: 'a,
// <T as Iterator>::Item: 'a
// {}
pub(super) fn opt_where_clause(p: &mut Parser) {
if !p.at(WHERE_KW) {
@ -104,7 +105,11 @@ pub(super) fn opt_where_clause(p: &mut Parser) {
let m = p.start();
p.bump();
loop {
if !(paths::is_path_start(p) || p.current() == LIFETIME || p.current() == FOR_KW) {
if !(paths::is_path_start(p)
|| p.current() == LIFETIME
|| p.current() == FOR_KW
|| p.current() == L_ANGLE)
{
break;
}
where_predicate(p);