mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Mark (method-)calls with never type as exit points
This commit is contained in:
parent
cc791538d6
commit
f283fce594
2 changed files with 58 additions and 9 deletions
|
@ -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, ..))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue