Mark (method-)calls with never type as exit points

This commit is contained in:
Lukas Wirth 2021-06-23 17:21:47 +02:00
parent cc791538d6
commit f283fce594
2 changed files with 58 additions and 9 deletions

View file

@ -2075,10 +2075,15 @@ impl Type {
pub fn is_unit(&self) -> bool {
matches!(self.ty.kind(&Interner), TyKind::Tuple(0, ..))
}
pub fn is_bool(&self) -> bool {
matches!(self.ty.kind(&Interner), TyKind::Scalar(Scalar::Bool))
}
pub fn is_never(&self) -> bool {
matches!(self.ty.kind(&Interner), TyKind::Never)
}
pub fn is_mutable_reference(&self) -> bool {
matches!(self.ty.kind(&Interner), TyKind::Ref(hir_ty::Mutability::Mut, ..))
}