Add Ty::is_union
predicate and use it
This commit is contained in:
parent
012c323467
commit
c898681a86
10 changed files with 31 additions and 55 deletions
|
@ -1840,6 +1840,11 @@ impl<'tcx> TyS<'tcx> {
|
|||
matches!(self.kind(), Adt(adt_def, _) if adt_def.is_enum())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_union(&self) -> bool {
|
||||
matches!(self.kind(), Adt(adt_def, _) if adt_def.is_union())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_closure(&self) -> bool {
|
||||
matches!(self.kind(), Closure(..))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue