aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-22 13:28:08 +0100
committerAleksey Kladov <[email protected]>2019-08-22 13:35:42 +0100
commit9f238930f1969731869c89956414f4b160b180c0 (patch)
tree182d17948da88b2acff477154cf54896e959efcd /crates/ra_syntax/src/ast
parent2d0931b9ba7aabdc634c799b32957cc6f057e875 (diff)
Don't add `?` bounds as real bounds
closes #1709
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index 2a59cf653..efe261fc2 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -382,6 +382,18 @@ impl ast::WherePred {
382 } 382 }
383} 383}
384 384
385impl ast::TypeBound {
386 pub fn question_mark_token(&self) -> Option<SyntaxToken> {
387 self.syntax()
388 .children_with_tokens()
389 .filter_map(|it| it.into_token())
390 .find(|it| it.kind() == T![?])
391 }
392 pub fn has_question_mark(&self) -> bool {
393 self.question_mark_token().is_some()
394 }
395}
396
385impl ast::TraitDef { 397impl ast::TraitDef {
386 pub fn is_auto(&self) -> bool { 398 pub fn is_auto(&self) -> bool {
387 self.syntax().children_with_tokens().any(|t| t.kind() == T![auto]) 399 self.syntax().children_with_tokens().any(|t| t.kind() == T![auto])