Address nits
This commit is contained in:
@@ -1269,16 +1269,16 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||||||
|
|
||||||
ty::IntVar(v) => {
|
ty::IntVar(v) => {
|
||||||
match self.inner.borrow_mut().int_unification_table().probe_value(v) {
|
match self.inner.borrow_mut().int_unification_table().probe_value(v) {
|
||||||
ty::IntVarValue::Unknown => ty,
|
|
||||||
ty::IntVarValue::IntType(ty) => Ty::new_int(self.tcx, ty),
|
ty::IntVarValue::IntType(ty) => Ty::new_int(self.tcx, ty),
|
||||||
ty::IntVarValue::UintType(ty) => Ty::new_uint(self.tcx, ty),
|
ty::IntVarValue::UintType(ty) => Ty::new_uint(self.tcx, ty),
|
||||||
|
ty::IntVarValue::Unknown => ty,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::FloatVar(v) => {
|
ty::FloatVar(v) => {
|
||||||
match self.inner.borrow_mut().float_unification_table().probe_value(v) {
|
match self.inner.borrow_mut().float_unification_table().probe_value(v) {
|
||||||
ty::FloatVarValue::Unknown => ty,
|
|
||||||
ty::FloatVarValue::Known(ty) => Ty::new_float(self.tcx, ty),
|
ty::FloatVarValue::Known(ty) => Ty::new_float(self.tcx, ty),
|
||||||
|
ty::FloatVarValue::Unknown => ty,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1644,7 +1644,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||||||
// If `inlined_probe_value` returns a value it's always a
|
// If `inlined_probe_value` returns a value it's always a
|
||||||
// `ty::Int(_)` or `ty::UInt(_)`, which never matches a
|
// `ty::Int(_)` or `ty::UInt(_)`, which never matches a
|
||||||
// `ty::Infer(_)`.
|
// `ty::Infer(_)`.
|
||||||
!self.inner.borrow_mut().int_unification_table().inlined_probe_value(v).is_unknown()
|
self.inner.borrow_mut().int_unification_table().inlined_probe_value(v).is_known()
|
||||||
}
|
}
|
||||||
|
|
||||||
TyOrConstInferVar::TyFloat(v) => {
|
TyOrConstInferVar::TyFloat(v) => {
|
||||||
@@ -1652,7 +1652,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||||||
// `ty::Float(_)`, which never matches a `ty::Infer(_)`.
|
// `ty::Float(_)`, which never matches a `ty::Infer(_)`.
|
||||||
//
|
//
|
||||||
// Not `inlined_probe_value(v)` because this call site is colder.
|
// Not `inlined_probe_value(v)` because this call site is colder.
|
||||||
!self.inner.borrow_mut().float_unification_table().probe_value(v).is_unknown()
|
self.inner.borrow_mut().float_unification_table().probe_value(v).is_known()
|
||||||
}
|
}
|
||||||
|
|
||||||
TyOrConstInferVar::Const(v) => {
|
TyOrConstInferVar::Const(v) => {
|
||||||
|
|||||||
@@ -723,8 +723,15 @@ pub enum IntVarValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl IntVarValue {
|
impl IntVarValue {
|
||||||
pub fn is_unknown(&self) -> bool {
|
pub fn is_known(self) -> bool {
|
||||||
matches!(self, IntVarValue::Unknown)
|
match self {
|
||||||
|
IntVarValue::IntType(_) | IntVarValue::UintType(_) => true,
|
||||||
|
IntVarValue::Unknown => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_unknown(self) -> bool {
|
||||||
|
!self.is_known()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -735,8 +742,15 @@ pub enum FloatVarValue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl FloatVarValue {
|
impl FloatVarValue {
|
||||||
pub fn is_unknown(&self) -> bool {
|
pub fn is_known(self) -> bool {
|
||||||
matches!(self, FloatVarValue::Unknown)
|
match self {
|
||||||
|
FloatVarValue::Known(_) => true,
|
||||||
|
FloatVarValue::Unknown => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn is_unknown(self) -> bool {
|
||||||
|
!self.is_known()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user