mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
negative_impl should take a TyCtxt
This commit is contained in:
parent
736c675d2a
commit
2faad3b699
@ -162,8 +162,8 @@ fn overlap_within_probe<'cx, 'tcx>(
|
||||
let infcx = selcx.infcx();
|
||||
|
||||
if overlap_mode.use_negative_impl() {
|
||||
if negative_impl(selcx, impl1_def_id, impl2_def_id)
|
||||
|| negative_impl(selcx, impl2_def_id, impl1_def_id)
|
||||
if negative_impl(infcx.tcx, impl1_def_id, impl2_def_id)
|
||||
|| negative_impl(infcx.tcx, impl2_def_id, impl1_def_id)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
@ -279,13 +279,8 @@ fn implicit_negative<'cx, 'tcx>(
|
||||
|
||||
/// Given impl1 and impl2 check if both impls are never satisfied by a common type (including
|
||||
/// where-clauses) If so, return true, they are disjoint and false otherwise.
|
||||
fn negative_impl<'cx, 'tcx>(
|
||||
selcx: &mut SelectionContext<'cx, 'tcx>,
|
||||
impl1_def_id: DefId,
|
||||
impl2_def_id: DefId,
|
||||
) -> bool {
|
||||
fn negative_impl<'tcx>(tcx: TyCtxt<'tcx>, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
|
||||
debug!("negative_impl(impl1_def_id={:?}, impl2_def_id={:?})", impl1_def_id, impl2_def_id);
|
||||
let tcx = selcx.infcx().tcx;
|
||||
|
||||
// Create an infcx, taking the predicates of impl1 as assumptions:
|
||||
let infcx = tcx.infer_ctxt().build();
|
||||
|
Loading…
Reference in New Issue
Block a user