about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-03-24 14:17:54 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-03-24 14:17:54 -0300
commitf4bd1e14bd40833576e770317912e1a67fc962f4 (patch)
tree591b7ca43d6737b79f70528026880957b49552c3
parent22b311bd826f0a79abfdd2483eed933e86baa31e (diff)
downloadrust-f4bd1e14bd40833576e770317912e1a67fc962f4.tar.gz
rust-f4bd1e14bd40833576e770317912e1a67fc962f4.zip
Normalize both trait and inherent
-rw-r--r--compiler/rustc_trait_selection/src/traits/coherence.rs25
1 files changed, 9 insertions, 16 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs
index 7ac6c083076..f3385df513f 100644
--- a/compiler/rustc_trait_selection/src/traits/coherence.rs
+++ b/compiler/rustc_trait_selection/src/traits/coherence.rs
@@ -305,22 +305,15 @@ fn negative_impl<'cx, 'tcx>(
     tcx.infer_ctxt().enter(|infcx| {
         // create a parameter environment corresponding to a (placeholder) instantiation of impl1
         let impl_env = tcx.param_env(impl1_def_id);
-        let subject1 = match tcx.impl_subject(impl1_def_id) {
-            ImplSubject::Trait(impl1_trait_ref) => {
-                match traits::fully_normalize(
-                    &infcx,
-                    FulfillmentContext::new(),
-                    ObligationCause::dummy(),
-                    impl_env,
-                    impl1_trait_ref,
-                ) {
-                    Ok(impl1_trait_ref) => ImplSubject::Trait(impl1_trait_ref),
-                    Err(err) => {
-                        bug!("failed to fully normalize {:?}: {:?}", impl1_trait_ref, err);
-                    }
-                }
-            }
-            subject @ ImplSubject::Inherent(_) => subject,
+        let subject1 = match traits::fully_normalize(
+            &infcx,
+            FulfillmentContext::new(),
+            ObligationCause::dummy(),
+            impl_env,
+            tcx.impl_subject(impl1_def_id),
+        ) {
+            Ok(s) => s,
+            Err(err) => bug!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
         };
 
         let (subject2, obligations) =