]> git.lizzy.rs Git - rust.git/commitdiff
Make the UnifyValue for RegionVid ()
authorJack Huey <jack.huey@umassmed.edu>
Fri, 14 May 2021 22:17:13 +0000 (18:17 -0400)
committerJack Huey <jack.huey@umassmed.edu>
Fri, 14 May 2021 22:17:13 +0000 (18:17 -0400)
compiler/rustc_infer/src/infer/region_constraints/mod.rs
compiler/rustc_middle/src/infer/unify_key.rs
src/test/ui/traits/inductive-overflow/lifetime.rs
src/test/ui/traits/inductive-overflow/lifetime.stderr

index 9ffcddfae99443d1bfc75dbf84b07edef719c48c..abbcff30cdaf2c20c1f7ae633ed2f2604a9a98a9 100644 (file)
@@ -3,7 +3,6 @@
 use self::CombineMapType::*;
 use self::UndoLog::*;
 
-use super::unify_key;
 use super::{
     InferCtxtUndoLogs, MiscVariable, RegionVariableOrigin, Rollback, Snapshot, SubregionOrigin,
 };
@@ -408,7 +407,7 @@ pub fn take_and_reset_data(&mut self) -> RegionConstraintData<'tcx> {
         if *any_unifications {
             *any_unifications = false;
             self.unification_table()
-                .reset_unifications(|vid| unify_key::RegionVidKey { min_vid: vid });
+                .reset_unifications(|_| ());
         }
 
         data
@@ -435,7 +434,7 @@ pub fn new_region_var(
     ) -> RegionVid {
         let vid = self.var_infos.push(RegionVariableInfo { origin, universe });
 
-        let u_vid = self.unification_table().new_key(unify_key::RegionVidKey { min_vid: vid });
+        let u_vid = self.unification_table().new_key(());
         assert_eq!(vid, u_vid);
         self.undo_log.push(AddVar(vid));
         debug!("created new region variable {:?} in {:?} with origin {:?}", vid, universe, origin);
@@ -618,7 +617,7 @@ pub fn glb_regions(
     }
 
     pub fn opportunistic_resolve_var(&mut self, rid: RegionVid) -> ty::RegionVid {
-        self.unification_table().probe_value(rid).min_vid
+        self.unification_table().find(rid)
     }
 
     fn combine_map(&mut self, t: CombineMapType) -> &mut CombineMap<'tcx> {
index 641cf23781e2c7407a568b64aea61e1810ca8694..8209e3db7396554d78dd56616b4189d053ae67b8 100644 (file)
@@ -38,7 +38,7 @@ fn unify_values(value1: &Self, value2: &Self) -> Result<Self, NoError> {
 }
 
 impl UnifyKey for ty::RegionVid {
-    type Value = RegionVidKey;
+    type Value = ();
     fn index(&self) -> u32 {
         u32::from(*self)
     }
index e23dfa57cd0d4d0257751da5daa63807ae6e71d2..d66c30ed2dd7fda43b274efbdd39eb40fbf11fae 100644 (file)
@@ -26,4 +26,6 @@ fn main() {
     // Should only be a few notes.
     is_send::<X<C<'static>>>();
     //~^ ERROR overflow evaluating
+    //~^^ 2 redundant
+    //~^^^ required because of
 }
index 752154b35cabebdaecd9f7a9d826754a3a28e635..cc91393039536b819ce5ac41b402338f5b01c5e6 100644 (file)
@@ -7,11 +7,13 @@ LL | fn is_send<S: NotAuto>() {}
 LL |     is_send::<X<C<'static>>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
+note: required because of the requirements on the impl of `NotAuto` for `X<C<'_>>`
   --> $DIR/lifetime.rs:19:12
    |
 LL | impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
    |            ^^^^^^^     ^^^^
+   = note: 2 redundant requirements hidden
+   = note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
 
 error: aborting due to previous error