about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-11-21 11:04:55 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-11-21 11:09:53 -0300
commit2faad3b699b7b80b08f4af7cfc67fff097256630 (patch)
tree26592c878c9c35b9cff3da1dbb730dc76a11d192
parent736c675d2ab65bcde6554e1b73340c2dbc27c85a (diff)
downloadrust-2faad3b699b7b80b08f4af7cfc67fff097256630.tar.gz
rust-2faad3b699b7b80b08f4af7cfc67fff097256630.zip
negative_impl should take a TyCtxt
-rw-r--r--compiler/rustc_trait_selection/src/traits/coherence.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs
index 3cf2959a9ff..8dd96934510 100644
--- a/compiler/rustc_trait_selection/src/traits/coherence.rs
+++ b/compiler/rustc_trait_selection/src/traits/coherence.rs
@@ -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();