Avoid accessing HIR from MIR queries.

This commit is contained in:
Camille GILLOT 2022-03-29 23:50:01 +02:00
parent 341883d051
commit db03a2deb0
10 changed files with 35 additions and 41 deletions

View file

@ -223,6 +223,14 @@ impl DefKind {
| DefKind::Impl => None,
}
}
#[inline]
pub fn is_fn_like(self) -> bool {
match self {
DefKind::Fn | DefKind::AssocFn | DefKind::Closure | DefKind::Generator => true,
_ => false,
}
}
}
/// The resolution of a path or export.