diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-09-09 07:35:19 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-09 07:35:19 +0000 |
| commit | d09f3d85a5dad718a9f0cec62ecbd62343f844e7 (patch) | |
| tree | 16e8f201405e353c2c1a048ef27654df8de97392 /src/tools/rust-analyzer | |
| parent | 564ba7c894975bed6e6dacbea423433163595148 (diff) | |
| parent | 2079d1126bcfb5ed125009f3ccfc67ebd7995d56 (diff) | |
| download | rust-d09f3d85a5dad718a9f0cec62ecbd62343f844e7.tar.gz rust-d09f3d85a5dad718a9f0cec62ecbd62343f844e7.zip | |
Merge pull request #20624 from A4-Tacks/fix-syn-lifetime-bounds
Fix LifetimeParam::lifetime_bounds invalid implement
Diffstat (limited to 'src/tools/rust-analyzer')
| -rw-r--r-- | src/tools/rust-analyzer/crates/syntax/src/ast/node_ext.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/tools/rust-analyzer/crates/syntax/src/ast/node_ext.rs b/src/tools/rust-analyzer/crates/syntax/src/ast/node_ext.rs index 42b0f5cf2da..af741d100f6 100644 --- a/src/tools/rust-analyzer/crates/syntax/src/ast/node_ext.rs +++ b/src/tools/rust-analyzer/crates/syntax/src/ast/node_ext.rs @@ -12,8 +12,8 @@ use rowan::{GreenNodeData, GreenTokenData}; use crate::{ NodeOrToken, SmolStr, SyntaxElement, SyntaxToken, T, TokenText, ast::{ - self, AstNode, AstToken, HasAttrs, HasGenericArgs, HasGenericParams, HasName, SyntaxNode, - support, + self, AstNode, AstToken, HasAttrs, HasGenericArgs, HasGenericParams, HasName, + HasTypeBounds, SyntaxNode, support, }, ted, }; @@ -912,11 +912,10 @@ impl ast::Visibility { impl ast::LifetimeParam { pub fn lifetime_bounds(&self) -> impl Iterator<Item = SyntaxToken> { - self.syntax() - .children_with_tokens() - .filter_map(|it| it.into_token()) - .skip_while(|x| x.kind() != T![:]) - .filter(|it| it.kind() == T![lifetime_ident]) + self.type_bound_list() + .into_iter() + .flat_map(|it| it.bounds()) + .filter_map(|it| it.lifetime()?.lifetime_ident_token()) } } |
