Suggest Semicolon in Incorrect Repeat Expressions
This commit is contained in:
parent
872aa75867
commit
98cc3457af
9 changed files with 144 additions and 25 deletions
|
@ -27,7 +27,7 @@ use crate::infer::canonical::Canonical;
|
|||
use crate::ty::InferTy::*;
|
||||
use crate::ty::{
|
||||
self, AdtDef, BoundRegionKind, Discr, GenericArg, GenericArgs, GenericArgsRef, List, ParamEnv,
|
||||
Region, Ty, TyCtxt, TypeFlags, TypeSuperVisitable, TypeVisitable, TypeVisitor,
|
||||
Region, Ty, TyCtxt, TypeFlags, TypeSuperVisitable, TypeVisitable, TypeVisitor, UintTy,
|
||||
};
|
||||
|
||||
// Re-export and re-parameterize some `I = TyCtxt<'tcx>` types here
|
||||
|
@ -1008,6 +1008,18 @@ impl<'tcx> Ty<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Check if type is an `usize`.
|
||||
#[inline]
|
||||
pub fn is_usize(self) -> bool {
|
||||
matches!(self.kind(), Uint(UintTy::Usize))
|
||||
}
|
||||
|
||||
/// Check if type is an `usize` or an integral type variable.
|
||||
#[inline]
|
||||
pub fn is_usize_like(self) -> bool {
|
||||
matches!(self.kind(), Uint(UintTy::Usize) | Infer(IntVar(_)))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_never(self) -> bool {
|
||||
matches!(self.kind(), Never)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue