about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-01-12 18:51:09 +0000
committerMichael Goulet <michael@errs.io>2023-01-12 20:44:47 +0000
commitd76e168f01e5ed6fc4bbdc127dacb121b51de098 (patch)
tree117d106f030bb32c60493434ed615103e2cf3138 /compiler/rustc_hir_analysis/src/check
parent1bc3683b3275a5eb2ed13d24edcdcbc59afe5d70 (diff)
downloadrust-d76e168f01e5ed6fc4bbdc127dacb121b51de098.tar.gz
rust-d76e168f01e5ed6fc4bbdc127dacb121b51de098.zip
Point at HIR types when impl trait ref doesn't normalize
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check')
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index d1f4dbc8d84..ca45e16d9d9 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -1254,7 +1254,11 @@ fn check_impl<'tcx>(
                 // therefore don't need to be WF (the trait's `Self: Trait` predicate
                 // won't hold).
                 let trait_ref = tcx.impl_trait_ref(item.owner_id).unwrap();
-                let trait_ref = wfcx.normalize(ast_trait_ref.path.span, None, trait_ref);
+                let trait_ref = wfcx.normalize(
+                    ast_trait_ref.path.span,
+                    Some(WellFormedLoc::Ty(item.hir_id().expect_owner().def_id)),
+                    trait_ref,
+                );
                 let trait_pred = ty::TraitPredicate {
                     trait_ref,
                     constness: match constness {