Skip to content

Commit f4bd1e1

Browse files
committed
Normalize both trait and inherent
1 parent 22b311b commit f4bd1e1

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

compiler/rustc_trait_selection/src/traits/coherence.rs

+9-16
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,15 @@ fn negative_impl<'cx, 'tcx>(
305305
tcx.infer_ctxt().enter(|infcx| {
306306
// create a parameter environment corresponding to a (placeholder) instantiation of impl1
307307
let impl_env = tcx.param_env(impl1_def_id);
308-
let subject1 = match tcx.impl_subject(impl1_def_id) {
309-
ImplSubject::Trait(impl1_trait_ref) => {
310-
match traits::fully_normalize(
311-
&infcx,
312-
FulfillmentContext::new(),
313-
ObligationCause::dummy(),
314-
impl_env,
315-
impl1_trait_ref,
316-
) {
317-
Ok(impl1_trait_ref) => ImplSubject::Trait(impl1_trait_ref),
318-
Err(err) => {
319-
bug!("failed to fully normalize {:?}: {:?}", impl1_trait_ref, err);
320-
}
321-
}
322-
}
323-
subject @ ImplSubject::Inherent(_) => subject,
308+
let subject1 = match traits::fully_normalize(
309+
&infcx,
310+
FulfillmentContext::new(),
311+
ObligationCause::dummy(),
312+
impl_env,
313+
tcx.impl_subject(impl1_def_id),
314+
) {
315+
Ok(s) => s,
316+
Err(err) => bug!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
324317
};
325318

326319
let (subject2, obligations) =

0 commit comments

Comments
 (0)