Normalize both trait and inherent
This commit is contained in:
parent
22b311bd82
commit
f4bd1e14bd
1 changed files with 9 additions and 16 deletions
|
@ -305,22 +305,15 @@ fn negative_impl<'cx, 'tcx>(
|
||||||
tcx.infer_ctxt().enter(|infcx| {
|
tcx.infer_ctxt().enter(|infcx| {
|
||||||
// create a parameter environment corresponding to a (placeholder) instantiation of impl1
|
// create a parameter environment corresponding to a (placeholder) instantiation of impl1
|
||||||
let impl_env = tcx.param_env(impl1_def_id);
|
let impl_env = tcx.param_env(impl1_def_id);
|
||||||
let subject1 = match tcx.impl_subject(impl1_def_id) {
|
let subject1 = match traits::fully_normalize(
|
||||||
ImplSubject::Trait(impl1_trait_ref) => {
|
|
||||||
match traits::fully_normalize(
|
|
||||||
&infcx,
|
&infcx,
|
||||||
FulfillmentContext::new(),
|
FulfillmentContext::new(),
|
||||||
ObligationCause::dummy(),
|
ObligationCause::dummy(),
|
||||||
impl_env,
|
impl_env,
|
||||||
impl1_trait_ref,
|
tcx.impl_subject(impl1_def_id),
|
||||||
) {
|
) {
|
||||||
Ok(impl1_trait_ref) => ImplSubject::Trait(impl1_trait_ref),
|
Ok(s) => s,
|
||||||
Err(err) => {
|
Err(err) => bug!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
|
||||||
bug!("failed to fully normalize {:?}: {:?}", impl1_trait_ref, err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
subject @ ImplSubject::Inherent(_) => subject,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let (subject2, obligations) =
|
let (subject2, obligations) =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue