Skip to content

Commit f342f38

Browse files
committed
Fix LifetimeParam::lifetime_bounds invalid implement
Lifetime node example: ``` [email protected] [email protected] [email protected] "'a" [email protected] ":" [email protected] " " [email protected] [email protected] [email protected] [email protected] "'b" ```
1 parent 1f4e5e8 commit f342f38

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/syntax/src/ast/node_ext.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use rowan::{GreenNodeData, GreenTokenData};
1212
use crate::{
1313
NodeOrToken, SmolStr, SyntaxElement, SyntaxToken, T, TokenText,
1414
ast::{
15-
self, AstNode, AstToken, HasAttrs, HasGenericArgs, HasGenericParams, HasName, SyntaxNode,
16-
support,
15+
self, AstNode, AstToken, HasAttrs, HasGenericArgs, HasGenericParams, HasName,
16+
HasTypeBounds, SyntaxNode, support,
1717
},
1818
ted,
1919
};
@@ -912,10 +912,10 @@ impl ast::Visibility {
912912

913913
impl ast::LifetimeParam {
914914
pub fn lifetime_bounds(&self) -> impl Iterator<Item = SyntaxToken> {
915-
self.syntax()
916-
.children_with_tokens()
915+
self.type_bound_list()
916+
.into_iter()
917+
.flat_map(|it| it.syntax().descendants_with_tokens())
917918
.filter_map(|it| it.into_token())
918-
.skip_while(|x| x.kind() != T![:])
919919
.filter(|it| it.kind() == T![lifetime_ident])
920920
}
921921
}

0 commit comments

Comments
 (0)