Skip to content

Commit

Permalink
Unrolled build for rust-lang#119107
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Dec 20, 2023
2 parents 3095d31 + df5b604 commit 04eac44
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
}

impl<'tcx, T> InferOk<'tcx, T> {
pub fn unit(self) -> InferOk<'tcx, ()> {
InferOk { value: (), obligations: self.obligations }
}

/// Extracts `value`, registering any obligations into `fulfill_cx`.
pub fn into_value_registering_obligations(
self,
Expand Down Expand Up @@ -1025,15 +1021,10 @@ impl<'tcx> InferCtxt<'tcx> {
_ => {}
}

Ok(self.commit_if_ok(|_snapshot| {
let ty::SubtypePredicate { a_is_expected, a, b } =
self.instantiate_binder_with_placeholders(predicate);

let ok =
self.at(cause, param_env).sub_exp(DefineOpaqueTypes::No, a_is_expected, a, b)?;
let ty::SubtypePredicate { a_is_expected, a, b } =
self.instantiate_binder_with_placeholders(predicate);

Ok(ok.unit())
}))
Ok(self.at(cause, param_env).sub_exp(DefineOpaqueTypes::No, a_is_expected, a, b))
}

pub fn region_outlives_predicate(
Expand Down

0 comments on commit 04eac44

Please sign in to comment.