Skip to content

Commit e8ab648

Browse files
committed
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).
1 parent 41a9cbe commit e8ab648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
812812
fn confirm_poly_trait_refs(
813813
&mut self,
814814
obligation: &TraitObligation<'tcx>,
815-
expected_trait_ref: ty::PolyTraitRef<'tcx>,
815+
self_ty_trait_ref: ty::PolyTraitRef<'tcx>,
816816
) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> {
817817
let obligation_trait_ref = obligation.predicate.to_poly_trait_ref();
818818
// Normalize the obligation and expected trait refs together, because why not
@@ -823,7 +823,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
823823
obligation.param_env,
824824
obligation.cause.clone(),
825825
obligation.recursion_depth + 1,
826-
(obligation_trait_ref, expected_trait_ref),
826+
(obligation_trait_ref, self_ty_trait_ref),
827827
)
828828
});
829829

0 commit comments

Comments
 (0)