Don't add ? bounds as real bounds

closes #1709
This commit is contained in:
Aleksey Kladov 2019-08-22 15:28:08 +03:00
parent 2d0931b9ba
commit 9f238930f1
3 changed files with 49 additions and 0 deletions

View file

@ -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])