Skip to content

Commit 1f96fd9

Browse files
committed
Use Region<I> instead of I::Region
1 parent 40b0ef9 commit 1f96fd9

29 files changed

Lines changed: 100 additions & 101 deletions

compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_type_ir::inherent::*;
33
use rustc_type_ir::solve::{Goal, QueryInput};
44
use rustc_type_ir::{
55
self as ty, Canonical, CanonicalParamEnvCacheEntry, CanonicalVarKind, Flags, InferCtxtLike,
6-
Interner, PlaceholderConst, PlaceholderType, TypeFlags, TypeFoldable, TypeFolder,
6+
Interner, PlaceholderConst, PlaceholderType, Region, TypeFlags, TypeFoldable, TypeFolder,
77
TypeSuperFoldable, TypeVisitableExt,
88
};
99

@@ -409,7 +409,7 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for Canonicaliz
409409
self.delegate.cx()
410410
}
411411

412-
fn fold_region(&mut self, r: I::Region) -> I::Region {
412+
fn fold_region(&mut self, r: Region<I>) -> Region<I> {
413413
let kind = match r.kind() {
414414
ty::ReBound(..) => return r,
415415

compiler/rustc_next_trait_solver/src/coherence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::ops::ControlFlow;
44
use derive_where::derive_where;
55
use rustc_type_ir::inherent::*;
66
use rustc_type_ir::{
7-
self as ty, InferCtxtLike, Interner, TrivialTypeTraversalImpls, TypeVisitable,
7+
self as ty, InferCtxtLike, Interner, Region, TrivialTypeTraversalImpls, TypeVisitable,
88
TypeVisitableExt, TypeVisitor,
99
};
1010
use tracing::instrument;
@@ -317,7 +317,7 @@ where
317317
{
318318
type Result = ControlFlow<OrphanCheckEarlyExit<I, E>>;
319319

320-
fn visit_region(&mut self, _r: I::Region) -> Self::Result {
320+
fn visit_region(&mut self, _r: Region<I>) -> Self::Result {
321321
ControlFlow::Continue(())
322322
}
323323

compiler/rustc_next_trait_solver/src/placeholder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_type_ir::data_structures::IndexMap;
44
use rustc_type_ir::inherent::*;
55
use rustc_type_ir::{
66
self as ty, InferCtxtLike, Interner, PlaceholderConst, PlaceholderRegion, PlaceholderType,
7-
TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt,
7+
Region, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitableExt,
88
};
99

1010
pub struct BoundVarReplacer<'a, Infcx, I = <Infcx as InferCtxtLike>::Interner>
@@ -90,7 +90,7 @@ where
9090
t
9191
}
9292

93-
fn fold_region(&mut self, r: I::Region) -> I::Region {
93+
fn fold_region(&mut self, r: Region<I>) -> Region<I> {
9494
match r.kind() {
9595
ty::ReBound(ty::BoundVarIndexKind::Bound(debruijn), _)
9696
if debruijn.as_usize()

compiler/rustc_next_trait_solver/src/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_type_ir::data_structures::DelayedMap;
22
use rustc_type_ir::inherent::*;
33
use rustc_type_ir::{
4-
self as ty, InferCtxtLike, Interner, TypeFoldable, TypeFolder, TypeSuperFoldable,
4+
self as ty, InferCtxtLike, Interner, Region, TypeFoldable, TypeFolder, TypeSuperFoldable,
55
TypeVisitableExt,
66
};
77

@@ -72,7 +72,7 @@ impl<D: SolverDelegate<Interner = I>, I: Interner> TypeFolder<I> for EagerResolv
7272
}
7373
}
7474

75-
fn fold_region(&mut self, r: I::Region) -> I::Region {
75+
fn fold_region(&mut self, r: Region<I>) -> Region<I> {
7676
match r.kind() {
7777
ty::ReVar(vid) => self.delegate.opportunistic_resolve_lt_var(vid),
7878
_ => r,

compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_type_ir::lang_items::SolverTraitLangItem;
1111
use rustc_type_ir::search_graph::CandidateHeadUsages;
1212
use rustc_type_ir::solve::{AliasBoundKind, SizedTraitKind};
1313
use rustc_type_ir::{
14-
self as ty, AliasTy, Interner, TypeFlags, TypeFoldable, TypeFolder, TypeSuperFoldable,
14+
self as ty, AliasTy, Interner, Region, TypeFlags, TypeFoldable, TypeFolder, TypeSuperFoldable,
1515
TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypingMode, Unnormalized,
1616
Upcast, elaborate,
1717
};
@@ -1368,7 +1368,7 @@ where
13681368
}
13691369
}
13701370

1371-
fn visit_region(&mut self, r: I::Region) -> Self::Result {
1371+
fn visit_region(&mut self, r: Region<I>) -> Self::Result {
13721372
match self.ecx.eager_resolve_region(r).kind() {
13731373
ty::ReStatic | ty::ReError(_) | ty::ReBound(..) => ControlFlow::Continue(()),
13741374
ty::RePlaceholder(p) => {

compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_type_ir::lang_items::{SolverLangItem, SolverTraitLangItem};
88
use rustc_type_ir::solve::SizedTraitKind;
99
use rustc_type_ir::solve::inspect::ProbeKind;
1010
use rustc_type_ir::{
11-
self as ty, Binder, FallibleTypeFolder, Interner, Movability, Mutability, TypeFoldable,
11+
self as ty, Binder, FallibleTypeFolder, Interner, Movability, Mutability, Region, TypeFoldable,
1212
TypeSuperFoldable, Unnormalized, Upcast as _, elaborate,
1313
};
1414
use rustc_type_ir_macros::{TypeFoldable_Generic, TypeVisitable_Generic};
@@ -435,7 +435,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<I:
435435
cx: I,
436436
self_ty: I::Ty,
437437
goal_kind: ty::ClosureKind,
438-
env_region: I::Region,
438+
env_region: Region<I>,
439439
) -> Result<(ty::Binder<I, AsyncCallableRelevantTypes<I>>, Vec<I::Predicate>), NoSolution> {
440440
match self_ty.kind() {
441441
ty::CoroutineClosure(def_id, args) => {
@@ -613,7 +613,7 @@ fn fn_item_to_async_callable<I: Interner>(
613613
fn coroutine_closure_to_certain_coroutine<I: Interner>(
614614
cx: I,
615615
goal_kind: ty::ClosureKind,
616-
goal_region: I::Region,
616+
goal_region: Region<I>,
617617
def_id: I::CoroutineClosureId,
618618
args: ty::CoroutineClosureArgs<I>,
619619
sig: ty::CoroutineClosureSignature<I>,
@@ -637,7 +637,7 @@ fn coroutine_closure_to_certain_coroutine<I: Interner>(
637637
fn coroutine_closure_to_ambiguous_coroutine<I: Interner>(
638638
cx: I,
639639
goal_kind: ty::ClosureKind,
640-
goal_region: I::Region,
640+
goal_region: Region<I>,
641641
def_id: I::CoroutineClosureId,
642642
args: ty::CoroutineClosureArgs<I>,
643643
sig: ty::CoroutineClosureSignature<I>,

compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_type_ir::relate::solver_relating::RelateExt;
1010
use rustc_type_ir::search_graph::{CandidateHeadUsages, PathKind};
1111
use rustc_type_ir::solve::OpaqueTypesJank;
1212
use rustc_type_ir::{
13-
self as ty, CanonicalVarValues, InferCtxtLike, Interner, TypeFoldable, TypeFolder,
13+
self as ty, CanonicalVarValues, InferCtxtLike, Interner, Region, TypeFoldable, TypeFolder,
1414
TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
1515
TypingMode,
1616
};
@@ -775,7 +775,7 @@ where
775775
}
776776
}
777777

778-
pub(super) fn next_region_var(&mut self) -> I::Region {
778+
pub(super) fn next_region_var(&mut self) -> Region<I> {
779779
let region = self.delegate.next_region_infer();
780780
self.inspect.add_var_value(region);
781781
region
@@ -1076,7 +1076,7 @@ where
10761076
self.delegate.shallow_resolve(ty)
10771077
}
10781078

1079-
pub(super) fn eager_resolve_region(&self, r: I::Region) -> I::Region {
1079+
pub(super) fn eager_resolve_region(&self, r: Region<I>) -> Region<I> {
10801080
if let ty::ReVar(vid) = r.kind() {
10811081
self.delegate.opportunistic_resolve_lt_var(vid)
10821082
} else {
@@ -1092,11 +1092,11 @@ where
10921092
args
10931093
}
10941094

1095-
pub(super) fn register_ty_outlives(&self, ty: I::Ty, lt: I::Region) {
1095+
pub(super) fn register_ty_outlives(&self, ty: I::Ty, lt: Region<I>) {
10961096
self.delegate.register_ty_outlives(ty, lt, self.origin_span);
10971097
}
10981098

1099-
pub(super) fn register_region_outlives(&self, a: I::Region, b: I::Region) {
1099+
pub(super) fn register_region_outlives(&self, a: Region<I>, b: Region<I>) {
11001100
// `'a: 'b` ==> `'b <= 'a`
11011101
self.delegate.sub_regions(b, a, self.origin_span);
11021102
}

compiler/rustc_next_trait_solver/src/solve/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod trait_goals;
2424
use derive_where::derive_where;
2525
use rustc_type_ir::inherent::*;
2626
pub use rustc_type_ir::solve::*;
27-
use rustc_type_ir::{self as ty, Interner, TyVid, TypingMode};
27+
use rustc_type_ir::{self as ty, Interner, Region, TyVid, TypingMode};
2828
use tracing::instrument;
2929

3030
pub use self::eval_ctxt::{
@@ -98,7 +98,7 @@ where
9898
#[instrument(level = "trace", skip(self))]
9999
fn compute_region_outlives_goal(
100100
&mut self,
101-
goal: Goal<I, ty::OutlivesPredicate<I, I::Region>>,
101+
goal: Goal<I, ty::OutlivesPredicate<I, Region<I>>>,
102102
) -> QueryResult<I> {
103103
let ty::OutlivesPredicate(a, b) = goal.predicate;
104104
self.register_region_outlives(a, b);

compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_type_ir::inherent::*;
88
use rustc_type_ir::lang_items::{SolverAdtLangItem, SolverLangItem, SolverTraitLangItem};
99
use rustc_type_ir::solve::SizedTraitKind;
1010
use rustc_type_ir::{
11-
self as ty, FieldInfo, Interner, NormalizesTo, PredicateKind, Unnormalized, Upcast as _,
11+
self as ty, FieldInfo, Interner, NormalizesTo, PredicateKind, Region, Unnormalized, Upcast as _,
1212
};
1313
use tracing::instrument;
1414

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use rustc_type_ir::solve::{
88
AliasBoundKind, CandidatePreferenceMode, CanonicalResponse, SizedTraitKind,
99
};
1010
use rustc_type_ir::{
11-
self as ty, FieldInfo, Interner, Movability, PredicatePolarity, TraitPredicate, TraitRef,
12-
TypeVisitableExt as _, TypingMode, Unnormalized, Upcast as _, elaborate,
11+
self as ty, FieldInfo, Interner, Movability, PredicatePolarity, Region, TraitPredicate,
12+
TraitRef, TypeVisitableExt as _, TypingMode, Unnormalized, Upcast as _, elaborate,
1313
};
1414
use tracing::{debug, instrument, trace};
1515

@@ -942,9 +942,9 @@ where
942942
&mut self,
943943
goal: Goal<I, (I::Ty, I::Ty)>,
944944
a_data: I::BoundExistentialPredicates,
945-
a_region: I::Region,
945+
a_region: Region<I>,
946946
b_data: I::BoundExistentialPredicates,
947-
b_region: I::Region,
947+
b_region: Region<I>,
948948
) -> Vec<Candidate<I>> {
949949
let cx = self.cx();
950950
let Goal { predicate: (a_ty, _b_ty), .. } = goal;
@@ -990,7 +990,7 @@ where
990990
&mut self,
991991
goal: Goal<I, (I::Ty, I::Ty)>,
992992
b_data: I::BoundExistentialPredicates,
993-
b_region: I::Region,
993+
b_region: Region<I>,
994994
) -> Result<Candidate<I>, NoSolution> {
995995
let cx = self.cx();
996996
let Goal { predicate: (a_ty, _), .. } = goal;
@@ -1032,9 +1032,9 @@ where
10321032
goal: Goal<I, (I::Ty, I::Ty)>,
10331033
source: CandidateSource<I>,
10341034
a_data: I::BoundExistentialPredicates,
1035-
a_region: I::Region,
1035+
a_region: Region<I>,
10361036
b_data: I::BoundExistentialPredicates,
1037-
b_region: I::Region,
1037+
b_region: Region<I>,
10381038
upcast_principal: Option<ty::Binder<I, ty::ExistentialTraitRef<I>>>,
10391039
) -> Result<Candidate<I>, NoSolution> {
10401040
let param_env = goal.param_env;

0 commit comments

Comments
 (0)