diff options
| author | Jack Huey <jack.huey@umassmed.edu> | 2021-05-14 18:17:13 -0400 |
|---|---|---|
| committer | Jack Huey <jack.huey@umassmed.edu> | 2021-05-14 18:17:13 -0400 |
| commit | e8c284ff2826e139fd77278af65a005a8b5b5bf3 (patch) | |
| tree | 44c75fcfde28d3458acd6a0bddfc9a552978e670 | |
| parent | 36a4d14c7edba21bba14df00b9e6e4a111dfc6f2 (diff) | |
| download | rust-e8c284ff2826e139fd77278af65a005a8b5b5bf3.tar.gz rust-e8c284ff2826e139fd77278af65a005a8b5b5bf3.zip | |
Make the UnifyValue for RegionVid ()
4 files changed, 9 insertions, 6 deletions
diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs index 9ffcddfae99..abbcff30cda 100644 --- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs +++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs @@ -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 @@ impl<'tcx> RegionConstraintCollector<'_, '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 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> { ) -> 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 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> { } 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> { diff --git a/compiler/rustc_middle/src/infer/unify_key.rs b/compiler/rustc_middle/src/infer/unify_key.rs index 641cf23781e..8209e3db739 100644 --- a/compiler/rustc_middle/src/infer/unify_key.rs +++ b/compiler/rustc_middle/src/infer/unify_key.rs @@ -38,7 +38,7 @@ impl UnifyValue for RegionVidKey { } impl UnifyKey for ty::RegionVid { - type Value = RegionVidKey; + type Value = (); fn index(&self) -> u32 { u32::from(*self) } diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs index e23dfa57cd0..d66c30ed2dd 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.rs +++ b/src/test/ui/traits/inductive-overflow/lifetime.rs @@ -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 } diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr index 752154b35ca..cc913930395 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.stderr +++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr @@ -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 |
