Skip to content

Commit

Permalink
Normalize both trait and inherent
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Mar 24, 2022
1 parent 22b311b commit f4bd1e1
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions compiler/rustc_trait_selection/src/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down

0 comments on commit f4bd1e1

Please sign in to comment.