Parse contextual dyn keyword properly in edition 2015

This commit is contained in:
Lukas Wirth 2024-07-19 20:20:00 +02:00
parent 9fd6c695da
commit f4199f786e
10 changed files with 164 additions and 11 deletions

View file

@ -2,6 +2,8 @@ use super::*;
pub(super) const PATH_FIRST: TokenSet =
TokenSet::new(&[IDENT, T![self], T![super], T![crate], T![Self], T![:], T![<]]);
pub(super) const WEAK_DYN_PATH_FIRST: TokenSet =
TokenSet::new(&[IDENT, T![self], T![super], T![crate], T![Self]]);
pub(super) fn is_path_start(p: &Parser<'_>) -> bool {
is_use_path_start(p) || p.at(T![<]) || p.at(T![Self])