fix: Fix incorrect parsing of use bounds

Also lower them a bit more
This commit is contained in:
Lukas Wirth 2024-10-22 12:09:06 +02:00
parent 17055aaca9
commit 95298a2e61
11 changed files with 184 additions and 25 deletions

View file

@ -795,7 +795,7 @@ pub enum TypeBoundKind {
/// for<'a> ...
ForType(ast::ForType),
/// use
Use(ast::GenericParamList),
Use(ast::UseBoundGenericArgs),
/// 'a
Lifetime(ast::Lifetime),
}
@ -806,8 +806,8 @@ impl ast::TypeBound {
TypeBoundKind::PathType(path_type)
} else if let Some(for_type) = support::children(self.syntax()).next() {
TypeBoundKind::ForType(for_type)
} else if let Some(generic_param_list) = self.generic_param_list() {
TypeBoundKind::Use(generic_param_list)
} else if let Some(args) = self.use_bound_generic_args() {
TypeBoundKind::Use(args)
} else if let Some(lifetime) = self.lifetime() {
TypeBoundKind::Lifetime(lifetime)
} else {