Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/node_ext.rs')
-rw-r--r--crates/syntax/src/ast/node_ext.rs22
1 files changed, 4 insertions, 18 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs
index 911e3d823d..5447906206 100644
--- a/crates/syntax/src/ast/node_ext.rs
+++ b/crates/syntax/src/ast/node_ext.rs
@@ -794,6 +794,8 @@ pub enum TypeBoundKind {
PathType(ast::PathType),
/// for<'a> ...
ForType(ast::ForType),
+ /// use
+ Use(ast::GenericParamList),
/// 'a
Lifetime(ast::Lifetime),
}
@@ -804,6 +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(lifetime) = self.lifetime() {
TypeBoundKind::Lifetime(lifetime)
} else {
@@ -1127,21 +1131,3 @@ impl From<ast::AssocItem> for ast::AnyHasAttrs {
Self::new(node)
}
}
-
-impl From<ast::Variant> for ast::AnyHasAttrs {
- fn from(node: ast::Variant) -> Self {
- Self::new(node)
- }
-}
-
-impl From<ast::RecordField> for ast::AnyHasAttrs {
- fn from(node: ast::RecordField) -> Self {
- Self::new(node)
- }
-}
-
-impl From<ast::TupleField> for ast::AnyHasAttrs {
- fn from(node: ast::TupleField) -> Self {
- Self::new(node)
- }
-}