Skip to content

Commit df5b604

Browse files
committed
subtype_predicate: remove unnecessary probe
1 parent e999d8b commit df5b604

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)