about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-05-09 07:16:59 +0000
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-05-09 07:16:59 +0000
commite8ab6489027098dbf4a407ddd0cedd0fbe40e3a4 (patch)
tree189eaa976cbaff985f79e2d505d57fdfa50bd60d
parent41a9cbeb64f486a27f5b22a6b1dafa9d693c0fb6 (diff)
downloadrust-e8ab6489027098dbf4a407ddd0cedd0fbe40e3a4.tar.gz
rust-e8ab6489027098dbf4a407ddd0cedd0fbe40e3a4.zip
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).
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index cf9c8b8fa23..4dc84e0ad10 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -812,7 +812,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     fn confirm_poly_trait_refs(
         &mut self,
         obligation: &TraitObligation<'tcx>,
-        expected_trait_ref: ty::PolyTraitRef<'tcx>,
+        self_ty_trait_ref: ty::PolyTraitRef<'tcx>,
     ) -> Result<Vec<PredicateObligation<'tcx>>, SelectionError<'tcx>> {
         let obligation_trait_ref = obligation.predicate.to_poly_trait_ref();
         // 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.cause.clone(),
                     obligation.recursion_depth + 1,
-                    (obligation_trait_ref, expected_trait_ref),
+                    (obligation_trait_ref, self_ty_trait_ref),
                 )
             });