Add hint for missing lifetime bound on trait object when type alias is used

This commit is contained in:
yanchen4791 2022-12-05 16:51:49 -08:00
parent c8e6a9e8b6
commit 62a1e76d2b
6 changed files with 176 additions and 19 deletions

View file

@ -3524,6 +3524,13 @@ impl<'hir> Node<'hir> {
}
}
pub fn alias_ty(self) -> Option<&'hir Ty<'hir>> {
match self {
Node::Item(Item { kind: ItemKind::TyAlias(ty, ..), .. }) => Some(ty),
_ => None,
}
}
pub fn body_id(&self) -> Option<BodyId> {
match self {
Node::TraitItem(TraitItem {