Handle auto traits & negative impls
We don't pass field types to Chalk yet though, so the auto trait inference won't be correct.
This commit is contained in:
@@ -170,6 +170,10 @@ impl ast::ImplBlock {
|
||||
let second = types.next();
|
||||
(first, second)
|
||||
}
|
||||
|
||||
pub fn is_negative(&self) -> bool {
|
||||
self.syntax().children_with_tokens().any(|t| t.kind() == EXCL)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
@@ -348,3 +352,9 @@ impl ast::WherePred {
|
||||
.find(|it| it.kind() == LIFETIME)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::TraitDef {
|
||||
pub fn is_auto(&self) -> bool {
|
||||
self.syntax().children_with_tokens().any(|t| t.kind() == AUTO_KW)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user