Handle self/super/crate in PathSegment as NameRef

This commit is contained in:
Lukas Wirth 2021-01-15 18:57:32 +01:00
parent 0c58aa9dc0
commit cb863390f2
42 changed files with 258 additions and 254 deletions

View file

@ -256,7 +256,7 @@ fn validate_path_keywords(segment: ast::PathSegment, errors: &mut Vec<SyntaxErro
));
}
} else if let Some(token) = segment.super_token() {
if !all_supers(&path) {
if segment.coloncolon_token().is_some() || !all_supers(&path) {
errors.push(SyntaxError::new(
"The `super` keyword may only be preceded by other `super`s",
token.text_range(),