Make ObligationCtxt::normalize take cause by borrow
This commit is contained in:
parent
ce409b5200
commit
1e236acd05
11 changed files with 27 additions and 29 deletions
|
@ -761,8 +761,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
hir_id,
|
||||
ObligationCauseCode::ItemObligation(callee),
|
||||
);
|
||||
let normalized_predicates =
|
||||
ocx.normalize(cause.clone(), param_env, predicates);
|
||||
let normalized_predicates = ocx.normalize(&cause, param_env, predicates);
|
||||
ocx.register_obligations(traits::predicates_for_generics(
|
||||
|_, _| cause.clone(),
|
||||
self.param_env,
|
||||
|
|
|
@ -46,8 +46,8 @@ pub fn is_subtype<'tcx>(
|
|||
let infcx = builder.build();
|
||||
let ocx = ObligationCtxt::new(&infcx);
|
||||
let cause = ObligationCause::dummy();
|
||||
let src = ocx.normalize(cause.clone(), param_env, src);
|
||||
let dest = ocx.normalize(cause.clone(), param_env, dest);
|
||||
let src = ocx.normalize(&cause, param_env, src);
|
||||
let dest = ocx.normalize(&cause, param_env, dest);
|
||||
match ocx.sub(&cause, param_env, src, dest) {
|
||||
Ok(()) => {}
|
||||
Err(_) => return false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue