diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-08-22 14:13:07 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-22 14:13:07 +0100 |
commit | 79a46f258854f8a81651f41cadffbe4d6139f2c5 (patch) | |
tree | d41acbbf7895f17fb4af653fa9e8b4bb1a9a2c93 /crates/ra_syntax/src | |
parent | 5c7d832bf9110350f0107791229172b0305f2701 (diff) | |
parent | 9f238930f1969731869c89956414f4b160b180c0 (diff) |
Merge #1717
1717: Don't add `?` bounds as real bounds r=flodiebold a=matklad
closes #1709
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/extensions.rs | 12 |
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 | ||
385 | impl 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 | |||
385 | impl ast::TraitDef { | 397 | impl 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]) |