Address some more nits
This commit is contained in:
parent
d793d80cf7
commit
ce11ae5d0d
3 changed files with 26 additions and 29 deletions
|
@ -87,12 +87,7 @@ impl<'me, 'tcx> AscribeUserTypeCx<'me, 'tcx> {
|
|||
where
|
||||
T: ToTrace<'tcx>,
|
||||
{
|
||||
Ok(self.ocx.register_infer_ok_obligations(
|
||||
self.ocx
|
||||
.infcx
|
||||
.at(&ObligationCause::dummy_with_span(self.span), self.param_env)
|
||||
.eq(a, b)?,
|
||||
))
|
||||
Ok(self.ocx.equate_types(&ObligationCause::dummy_with_span(self.span), self.param_env, a, b)?)
|
||||
}
|
||||
|
||||
fn prove_predicate(&self, predicate: Predicate<'tcx>, cause: ObligationCause<'tcx>) {
|
||||
|
@ -181,10 +176,7 @@ fn type_op_eq<'tcx>(
|
|||
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
||||
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| {
|
||||
let (param_env, Eq { a, b }) = key.into_parts();
|
||||
ocx.register_infer_ok_obligations(
|
||||
ocx.infcx.at(&ObligationCause::dummy(), param_env).eq(a, b)?,
|
||||
);
|
||||
Ok(())
|
||||
Ok(ocx.equate_types(&ObligationCause::dummy(), param_env, a, b)?)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -236,10 +228,7 @@ fn type_op_subtype<'tcx>(
|
|||
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
||||
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| {
|
||||
let (param_env, Subtype { sub, sup }) = key.into_parts();
|
||||
ocx.register_infer_ok_obligations(
|
||||
ocx.infcx.at(&ObligationCause::dummy(), param_env).sup(sup, sub)?,
|
||||
);
|
||||
Ok(())
|
||||
Ok(ocx.sup_types(&ObligationCause::dummy(), param_env, sup, sub)?)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue