Make strict_disjoint use explicit_disjoint
This commit is contained in:
parent
1ec962fb34
commit
19e3c86003
@ -206,14 +206,19 @@ fn overlap_within_probe<'cx, 'tcx>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
OverlapMode::Strict => {
|
OverlapMode::Strict => {
|
||||||
if strict_disjoint(selcx, param_env, &impl1_header, impl2_header) {
|
if strict_disjoint(selcx, impl1_def_id, impl2_def_id) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equate for error reporting
|
||||||
|
let _ = selcx
|
||||||
|
.infcx()
|
||||||
|
.at(&ObligationCause::dummy(), param_env)
|
||||||
|
.eq_impl_headers(&impl1_header, &impl2_header);
|
||||||
}
|
}
|
||||||
OverlapMode::WithNegative => {
|
OverlapMode::WithNegative => {
|
||||||
if stable_disjoint(selcx, param_env, &impl1_header, impl2_header)
|
if stable_disjoint(selcx, param_env, &impl1_header, impl2_header)
|
||||||
|| explicit_disjoint(selcx, impl1_def_id, impl2_def_id)
|
|| strict_disjoint(selcx, impl1_def_id, impl2_def_id)
|
||||||
|| explicit_disjoint(selcx, impl2_def_id, impl1_def_id)
|
|
||||||
{
|
{
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -255,13 +260,11 @@ fn stable_disjoint<'cx, 'tcx>(
|
|||||||
|
|
||||||
fn strict_disjoint<'cx, 'tcx>(
|
fn strict_disjoint<'cx, 'tcx>(
|
||||||
selcx: &mut SelectionContext<'cx, 'tcx>,
|
selcx: &mut SelectionContext<'cx, 'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
impl1_def_id: DefId,
|
||||||
impl1_header: &ty::ImplHeader<'tcx>,
|
impl2_def_id: DefId,
|
||||||
impl2_header: ty::ImplHeader<'tcx>,
|
|
||||||
) -> bool {
|
) -> bool {
|
||||||
disjoint_with_filter(selcx, param_env, impl1_header, impl2_header, |selcx, o| {
|
explicit_disjoint(selcx, impl1_def_id, impl2_def_id)
|
||||||
strict_check(selcx, o)
|
|| explicit_disjoint(selcx, impl2_def_id, impl1_def_id)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn disjoint_with_filter<'cx, 'tcx>(
|
fn disjoint_with_filter<'cx, 'tcx>(
|
||||||
|
Loading…
Reference in New Issue
Block a user