Skip to content

Commit e8c284f

Browse files
committed
Make the UnifyValue for RegionVid ()
1 parent 36a4d14 commit e8c284f

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

compiler/rustc_infer/src/infer/region_constraints/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use self::CombineMapType::*;
44
use self::UndoLog::*;
55

6-
use super::unify_key;
76
use super::{
87
InferCtxtUndoLogs, MiscVariable, RegionVariableOrigin, Rollback, Snapshot, SubregionOrigin,
98
};
@@ -408,7 +407,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
408407
if *any_unifications {
409408
*any_unifications = false;
410409
self.unification_table()
411-
.reset_unifications(|vid| unify_key::RegionVidKey { min_vid: vid });
410+
.reset_unifications(|_| ());
412411
}
413412

414413
data
@@ -435,7 +434,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
435434
) -> RegionVid {
436435
let vid = self.var_infos.push(RegionVariableInfo { origin, universe });
437436

438-
let u_vid = self.unification_table().new_key(unify_key::RegionVidKey { min_vid: vid });
437+
let u_vid = self.unification_table().new_key(());
439438
assert_eq!(vid, u_vid);
440439
self.undo_log.push(AddVar(vid));
441440
debug!("created new region variable {:?} in {:?} with origin {:?}", vid, universe, origin);
@@ -618,7 +617,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
618617
}
619618

620619
pub fn opportunistic_resolve_var(&mut self, rid: RegionVid) -> ty::RegionVid {
621-
self.unification_table().probe_value(rid).min_vid
620+
self.unification_table().find(rid)
622621
}
623622

624623
fn combine_map(&mut self, t: CombineMapType) -> &mut CombineMap<'tcx> {

compiler/rustc_middle/src/infer/unify_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl UnifyValue for RegionVidKey {
3838
}
3939

4040
impl UnifyKey for ty::RegionVid {
41-
type Value = RegionVidKey;
41+
type Value = ();
4242
fn index(&self) -> u32 {
4343
u32::from(*self)
4444
}

src/test/ui/traits/inductive-overflow/lifetime.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ fn main() {
2626
// Should only be a few notes.
2727
is_send::<X<C<'static>>>();
2828
//~^ ERROR overflow evaluating
29+
//~^^ 2 redundant
30+
//~^^^ required because of
2931
}

src/test/ui/traits/inductive-overflow/lifetime.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ LL | fn is_send<S: NotAuto>() {}
77
LL | is_send::<X<C<'static>>>();
88
| ^^^^^^^^^^^^^^^^^^^^^^^^
99
|
10-
note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
10+
note: required because of the requirements on the impl of `NotAuto` for `X<C<'_>>`
1111
--> $DIR/lifetime.rs:19:12
1212
|
1313
LL | impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
1414
| ^^^^^^^ ^^^^
15+
= note: 2 redundant requirements hidden
16+
= note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
1517

1618
error: aborting due to previous error
1719

0 commit comments

Comments
 (0)