Rename expected_trait_ref
to self_ty_trait_ref
This trait ref is derived from the self type and then equated to the trait ref from the obligation. For example, for `fn(): Fn(u32)`, `self_ty_trait_ref` is `Fn()`, which is then equated to `Fn(u32)` (which will fail, causing the obligation to fail).
This commit is contained in:
parent
41a9cbeb64
commit
e8ab648902
@ -812,7 +812,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
fn confirm_poly_trait_refs(
|
fn confirm_poly_trait_refs(
|
||||||
&mut self,
|
&mut self,
|
||||||
obligation: &TraitObligation<'tcx>,
|
obligation: &TraitObligation<'tcx>,
|
||||||
expected_trait_ref: ty::PolyTraitRef<'tcx>,
|
self_ty_trait_ref: ty::PolyTraitRef<'tcx>,
|
||||||
) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> {
|
) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> {
|
||||||
let obligation_trait_ref = obligation.predicate.to_poly_trait_ref();
|
let obligation_trait_ref = obligation.predicate.to_poly_trait_ref();
|
||||||
// Normalize the obligation and expected trait refs together, because why not
|
// Normalize the obligation and expected trait refs together, because why not
|
||||||
@ -823,7 +823,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||||||
obligation.param_env,
|
obligation.param_env,
|
||||||
obligation.cause.clone(),
|
obligation.cause.clone(),
|
||||||
obligation.recursion_depth + 1,
|
obligation.recursion_depth + 1,
|
||||||
(obligation_trait_ref, expected_trait_ref),
|
(obligation_trait_ref, self_ty_trait_ref),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user