mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
parent
2d0931b9ba
commit
9f238930f1
3 changed files with 49 additions and 0 deletions
|
@ -382,6 +382,18 @@ impl ast::WherePred {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::TypeBound {
|
||||
pub fn question_mark_token(&self) -> Option<SyntaxToken> {
|
||||
self.syntax()
|
||||
.children_with_tokens()
|
||||
.filter_map(|it| it.into_token())
|
||||
.find(|it| it.kind() == T![?])
|
||||
}
|
||||
pub fn has_question_mark(&self) -> bool {
|
||||
self.question_mark_token().is_some()
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::TraitDef {
|
||||
pub fn is_auto(&self) -> bool {
|
||||
self.syntax().children_with_tokens().any(|t| t.kind() == T![auto])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue