Skip to content

Commit 8924fa5

Browse files
Rollup merge of #119107 - lcnr:uwuwu, r=compiler-errors
subtype_predicate: remove unnecessary probe There is no reason to probe here. The failure either results in an actual type error, in which cases the probe is useless, or it is used inside of evaluate, in which case we're already inside of the `fn evaluation_probe`, so it is also not necessary.
2 parents 184ecac + df5b604 commit 8924fa5

File tree

1 file changed

+3
-12
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+3
-12
lines changed

compiler/rustc_infer/src/infer/mod.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
713713
}
714714

715715
impl<'tcx, T> InferOk<'tcx, T> {
716-
pub fn unit(self) -> InferOk<'tcx, ()> {
717-
InferOk { value: (), obligations: self.obligations }
718-
}
719-
720716
/// Extracts `value`, registering any obligations into `fulfill_cx`.
721717
pub fn into_value_registering_obligations(
722718
self,
@@ -1025,15 +1021,10 @@ impl<'tcx> InferCtxt<'tcx> {
10251021
_ => {}
10261022
}
10271023

1028-
Ok(self.commit_if_ok(|_snapshot| {
1029-
let ty::SubtypePredicate { a_is_expected, a, b } =
1030-
self.instantiate_binder_with_placeholders(predicate);
1031-
1032-
let ok =
1033-
self.at(cause, param_env).sub_exp(DefineOpaqueTypes::No, a_is_expected, a, b)?;
1024+
let ty::SubtypePredicate { a_is_expected, a, b } =
1025+
self.instantiate_binder_with_placeholders(predicate);
10341026

1035-
Ok(ok.unit())
1036-
}))
1027+
Ok(self.at(cause, param_env).sub_exp(DefineOpaqueTypes::No, a_is_expected, a, b))
10371028
}
10381029

10391030
pub fn region_outlives_predicate(

0 commit comments

Comments
 (0)