[[package]]
name = "ena"
-version = "0.13.0"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dc01d68e08ca384955a3aeba9217102ca1aa85b6e168639bf27739f1d749d87"
+checksum = "8944dc8fa28ce4a38f778bd46bf7d923fe73eed5a439398507246c8e017e6f36"
dependencies = [
"log",
]
use self::type_variable::TypeVariableValue;
// See the comment in `shallow_resolve()`.
- match self.infcx.type_variables.borrow_mut().probe(v) {
+ match self.infcx.type_variables.borrow_mut().inlined_probe(v) {
TypeVariableValue::Known { value: t } => self.fold_ty(t) != typ,
TypeVariableValue::Unknown { .. } => false,
}
}
ty::Infer(ty::IntVar(v)) => {
- match self.infcx.int_unification_table.borrow_mut().probe_value(v) {
+ match self.infcx.int_unification_table.borrow_mut().inlined_probe_value(v) {
Some(v) => v.to_type(self.infcx.tcx) != typ,
None => false,
}
}
ty::Infer(ty::FloatVar(v)) => {
+ // Not `inlined_probe_value(v)` because this call site is colder.
match self.infcx.float_unification_table.borrow_mut().probe_value(v) {
Some(v) => v.to_type(self.infcx.tcx) != typ,
None => false,
/// Retrieves the type to which `vid` has been instantiated, if
/// any.
pub fn probe(&mut self, vid: ty::TyVid) -> TypeVariableValue<'tcx> {
- self.eq_relations.probe_value(vid)
+ self.inlined_probe(vid)
+ }
+
+ /// An always-inlined variant of `probe`, for very hot call sites.
+ #[inline(always)]
+ pub fn inlined_probe(&mut self, vid: ty::TyVid) -> TypeVariableValue<'tcx> {
+ self.eq_relations.inlined_probe_value(vid)
}
/// If `t` is a type-inference variable, and it has been