Skip to content

Commit dd0739a

Browse files
committed
continue renaming
- `RegionVariableOrigin::~~Late~~BoundRegion` - `~~Late~~BoundRegionConversionTime`
1 parent 86fa131 commit dd0739a

File tree

16 files changed

+44
-44
lines changed

16 files changed

+44
-44
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir as hir;
1010
use rustc_hir::def::{CtorKind, Namespace};
1111
use rustc_hir::CoroutineKind;
1212
use rustc_index::IndexSlice;
13-
use rustc_infer::infer::LateBoundRegionConversionTime;
13+
use rustc_infer::infer::BoundRegionConversionTime;
1414
use rustc_middle::mir::tcx::PlaceTy;
1515
use rustc_middle::mir::{
1616
AggregateKind, CallSource, ConstOperand, FakeReadCause, Local, LocalInfo, LocalKind, Location,
@@ -1113,7 +1113,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
11131113
&& let ty::Ref(_, _, hir::Mutability::Mut) = args.type_at(0).kind()
11141114
&& let self_ty = self.infcx.instantiate_binder_with_fresh_vars(
11151115
fn_call_span,
1116-
LateBoundRegionConversionTime::FnCall,
1116+
BoundRegionConversionTime::FnCall,
11171117
tcx.fn_sig(method_did).instantiate(tcx, method_args).input(0),
11181118
)
11191119
&& self.infcx.can_eq(self.param_env, ty, self_ty)

compiler/rustc_borrowck/src/type_check/input_output.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! `RETURN_PLACE` the MIR arguments) are always fully normalized (and
88
//! contain revealed `impl Trait` values).
99
10-
use rustc_infer::infer::LateBoundRegionConversionTime;
10+
use rustc_infer::infer::BoundRegionConversionTime;
1111
use rustc_middle::mir::*;
1212
use rustc_middle::ty::{self, Ty};
1313
use rustc_span::Span;
@@ -35,7 +35,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
3535
.instantiate_canonical_with_fresh_inference_vars(body.span, &user_provided_poly_sig);
3636
let user_provided_sig = self.infcx.instantiate_binder_with_fresh_vars(
3737
body.span,
38-
LateBoundRegionConversionTime::FnCall,
38+
BoundRegionConversionTime::FnCall,
3939
user_provided_sig,
4040
);
4141

compiler/rustc_borrowck/src/type_check/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use rustc_infer::infer::outlives::env::RegionBoundPairs;
2121
use rustc_infer::infer::region_constraints::RegionConstraintData;
2222
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
2323
use rustc_infer::infer::{
24-
InferCtxt, LateBoundRegion, LateBoundRegionConversionTime, NllRegionVariableOrigin,
24+
BoundRegion, BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin,
2525
};
2626
use rustc_middle::mir::tcx::PlaceTy;
2727
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
@@ -1401,10 +1401,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14011401
};
14021402

14031403
self.infcx.next_region_var(
1404-
LateBoundRegion(
1404+
BoundRegion(
14051405
term.source_info.span,
14061406
br.kind,
1407-
LateBoundRegionConversionTime::FnCall,
1407+
BoundRegionConversionTime::FnCall,
14081408
),
14091409
region_ctxt_fn,
14101410
)

compiler/rustc_hir_typeck/src/closure.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_hir as hir;
77
use rustc_hir::lang_items::LangItem;
88
use rustc_hir_analysis::astconv::AstConv;
99
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
10-
use rustc_infer::infer::{DefineOpaqueTypes, LateBoundRegionConversionTime};
10+
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes};
1111
use rustc_infer::infer::{InferOk, InferResult};
1212
use rustc_macros::{TypeFoldable, TypeVisitable};
1313
use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt};
@@ -558,7 +558,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
558558
// Instantiate (this part of..) S to S', i.e., with fresh variables.
559559
self.instantiate_binder_with_fresh_vars(
560560
hir_ty.span,
561-
LateBoundRegionConversionTime::FnCall,
561+
BoundRegionConversionTime::FnCall,
562562
// (*) binder moved to here
563563
supplied_sig.inputs().rebind(supplied_ty),
564564
)
@@ -583,7 +583,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
583583

584584
let supplied_output_ty = self.instantiate_binder_with_fresh_vars(
585585
decl.output.span(),
586-
LateBoundRegionConversionTime::FnCall,
586+
BoundRegionConversionTime::FnCall,
587587
supplied_sig.output(),
588588
);
589589
let cause = &self.misc(decl.output.span());

compiler/rustc_hir_typeck/src/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
564564
let span = args.get(i).map(|a| a.span).unwrap_or(expr.span);
565565
let input = self.instantiate_binder_with_fresh_vars(
566566
span,
567-
infer::LateBoundRegionConversionTime::FnCall,
567+
infer::BoundRegionConversionTime::FnCall,
568568
fn_sig.input(i),
569569
);
570570
self.require_type_is_sized_deferred(
@@ -582,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
582582
// with fresh vars.
583583
let output = self.instantiate_binder_with_fresh_vars(
584584
expr.span,
585-
infer::LateBoundRegionConversionTime::FnCall,
585+
infer::BoundRegionConversionTime::FnCall,
586586
fn_sig.output(),
587587
);
588588
self.require_type_is_sized_deferred(output, expr.span, traits::SizedReturnType);

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
289289
) -> Ty<'tcx> {
290290
let trait_ref = self.instantiate_binder_with_fresh_vars(
291291
span,
292-
infer::LateBoundRegionConversionTime::AssocTypeProjection(item_def_id),
292+
infer::BoundRegionConversionTime::AssocTypeProjection(item_def_id),
293293
poly_trait_ref,
294294
);
295295

compiler/rustc_hir_typeck/src/method/probe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
853853
self.elaborate_bounds(bounds, |this, poly_trait_ref, item| {
854854
let trait_ref = this.instantiate_binder_with_fresh_vars(
855855
this.span,
856-
infer::LateBoundRegionConversionTime::FnCall,
856+
infer::BoundRegionConversionTime::FnCall,
857857
poly_trait_ref,
858858
);
859859

@@ -971,7 +971,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
971971
} else {
972972
let new_trait_ref = self.instantiate_binder_with_fresh_vars(
973973
self.span,
974-
infer::LateBoundRegionConversionTime::FnCall,
974+
infer::BoundRegionConversionTime::FnCall,
975975
bound_trait_ref,
976976
);
977977

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2768,13 +2768,13 @@ impl<'tcx> InferCtxt<'tcx> {
27682768
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
27692769
infer::Autoref(_) => " for autoref".to_string(),
27702770
infer::Coercion(_) => " for automatic coercion".to_string(),
2771-
infer::LateBoundRegion(_, br, infer::FnCall) => {
2771+
infer::BoundRegion(_, br, infer::FnCall) => {
27722772
format!(" for lifetime parameter {}in function call", br_string(br))
27732773
}
2774-
infer::LateBoundRegion(_, br, infer::HigherRankedType) => {
2774+
infer::BoundRegion(_, br, infer::HigherRankedType) => {
27752775
format!(" for lifetime parameter {}in generic type", br_string(br))
27762776
}
2777-
infer::LateBoundRegion(_, br, infer::AssocTypeProjection(def_id)) => format!(
2777+
infer::BoundRegion(_, br, infer::AssocTypeProjection(def_id)) => format!(
27782778
" for lifetime parameter {}in trait containing associated type `{}`",
27792779
br_string(br),
27802780
self.tcx.associated_item(def_id).name

compiler/rustc_infer/src/infer/mod.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pub use self::at::DefineOpaqueTypes;
22
pub use self::freshen::TypeFreshener;
33
pub use self::lexical_region_resolve::RegionResolutionError;
4-
pub use self::LateBoundRegionConversionTime::*;
4+
pub use self::BoundRegionConversionTime::*;
55
pub use self::RegionVariableOrigin::*;
66
pub use self::SubregionOrigin::*;
77
pub use self::ValuePairs::*;
@@ -472,9 +472,9 @@ impl<'tcx> SubregionOrigin<'tcx> {
472472
}
473473
}
474474

475-
/// Times when we replace late-bound regions with variables:
475+
/// Times when we replace bound regions with existentials:
476476
#[derive(Clone, Copy, Debug)]
477-
pub enum LateBoundRegionConversionTime {
477+
pub enum BoundRegionConversionTime {
478478
/// when a fn is called
479479
FnCall,
480480

@@ -510,9 +510,9 @@ pub enum RegionVariableOrigin {
510510
/// Region variables created as the values for early-bound regions.
511511
EarlyBoundRegion(Span, Symbol),
512512

513-
/// Region variables created for bound regions
514-
/// in a function or method that is called.
515-
LateBoundRegion(Span, ty::BoundRegionKind, LateBoundRegionConversionTime),
513+
/// Region variables created when instantiating a binder with
514+
/// existential variables, e.g. when calling a function or method.
515+
BoundRegion(Span, ty::BoundRegionKind, BoundRegionConversionTime),
516516

517517
UpvarRegion(ty::UpvarId, Span),
518518

@@ -1456,13 +1456,13 @@ impl<'tcx> InferCtxt<'tcx> {
14561456
// variables in the current universe.
14571457
//
14581458
// Use this method if you'd like to find some substitution of the binder's
1459-
// variables (e.g. during a method call). If there isn't a [`LateBoundRegionConversionTime`]
1459+
// variables (e.g. during a method call). If there isn't a [`BoundRegionConversionTime`]
14601460
// that corresponds to your use case, consider whether or not you should
14611461
// use [`InferCtxt::instantiate_binder_with_placeholders`] instead.
14621462
pub fn instantiate_binder_with_fresh_vars<T>(
14631463
&self,
14641464
span: Span,
1465-
lbrct: LateBoundRegionConversionTime,
1465+
lbrct: BoundRegionConversionTime,
14661466
value: ty::Binder<'tcx, T>,
14671467
) -> T
14681468
where
@@ -1475,7 +1475,7 @@ impl<'tcx> InferCtxt<'tcx> {
14751475
struct ToFreshVars<'a, 'tcx> {
14761476
infcx: &'a InferCtxt<'tcx>,
14771477
span: Span,
1478-
lbrct: LateBoundRegionConversionTime,
1478+
lbrct: BoundRegionConversionTime,
14791479
map: FxHashMap<ty::BoundVar, ty::GenericArg<'tcx>>,
14801480
}
14811481

@@ -1485,7 +1485,7 @@ impl<'tcx> InferCtxt<'tcx> {
14851485
.entry(br.var)
14861486
.or_insert_with(|| {
14871487
self.infcx
1488-
.next_region_var(LateBoundRegion(self.span, br.kind, self.lbrct))
1488+
.next_region_var(BoundRegion(self.span, br.kind, self.lbrct))
14891489
.into()
14901490
})
14911491
.expect_region()
@@ -2042,7 +2042,7 @@ impl RegionVariableOrigin {
20422042
| Autoref(a)
20432043
| Coercion(a)
20442044
| EarlyBoundRegion(a, ..)
2045-
| LateBoundRegion(a, ..)
2045+
| BoundRegion(a, ..)
20462046
| UpvarRegion(_, a) => a,
20472047
Nll(..) => bug!("NLL variable used with `span`"),
20482048
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_infer::infer::at::ToTrace;
44
use rustc_infer::infer::canonical::CanonicalVarValues;
55
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
66
use rustc_infer::infer::{
7-
DefineOpaqueTypes, InferCtxt, InferOk, LateBoundRegionConversionTime, TyCtxtInferExt,
7+
BoundRegionConversionTime, DefineOpaqueTypes, InferCtxt, InferOk, TyCtxtInferExt,
88
};
99
use rustc_infer::traits::query::NoSolution;
1010
use rustc_infer::traits::ObligationCause;
@@ -780,7 +780,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
780780
) -> T {
781781
self.infcx.instantiate_binder_with_fresh_vars(
782782
DUMMY_SP,
783-
LateBoundRegionConversionTime::HigherRankedType,
783+
BoundRegionConversionTime::HigherRankedType,
784784
value,
785785
)
786786
}

compiler/rustc_trait_selection/src/traits/error_reporting/ambiguity.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_hir::def_id::DefId;
2-
use rustc_infer::infer::{InferCtxt, LateBoundRegionConversionTime};
2+
use rustc_infer::infer::{BoundRegionConversionTime, InferCtxt};
33
use rustc_infer::traits::util::elaborate;
44
use rustc_infer::traits::{Obligation, ObligationCause, PolyTraitObligation};
55
use rustc_middle::ty;
@@ -53,7 +53,7 @@ pub fn recompute_applicable_impls<'tcx>(
5353

5454
let param_env_predicate = infcx.instantiate_binder_with_fresh_vars(
5555
DUMMY_SP,
56-
LateBoundRegionConversionTime::HigherRankedType,
56+
BoundRegionConversionTime::HigherRankedType,
5757
poly_trait_predicate,
5858
);
5959
let param_env_trait_ref =

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_hir::{CoroutineKind, CoroutineSource, Node};
2626
use rustc_hir::{Expr, HirId};
2727
use rustc_infer::infer::error_reporting::TypeErrCtxt;
2828
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
29-
use rustc_infer::infer::{DefineOpaqueTypes, InferOk, LateBoundRegionConversionTime};
29+
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk};
3030
use rustc_middle::hir::map;
3131
use rustc_middle::traits::IsConstable;
3232
use rustc_middle::ty::error::TypeError::{self, Sorts};
@@ -908,7 +908,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
908908

909909
let self_ty = self.instantiate_binder_with_fresh_vars(
910910
DUMMY_SP,
911-
LateBoundRegionConversionTime::FnCall,
911+
BoundRegionConversionTime::FnCall,
912912
trait_pred.self_ty(),
913913
);
914914

@@ -1237,7 +1237,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
12371237

12381238
let output = self.instantiate_binder_with_fresh_vars(
12391239
DUMMY_SP,
1240-
LateBoundRegionConversionTime::FnCall,
1240+
BoundRegionConversionTime::FnCall,
12411241
output,
12421242
);
12431243
let inputs = inputs
@@ -1246,7 +1246,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
12461246
.map(|ty| {
12471247
self.instantiate_binder_with_fresh_vars(
12481248
DUMMY_SP,
1249-
LateBoundRegionConversionTime::FnCall,
1249+
BoundRegionConversionTime::FnCall,
12501250
inputs.rebind(*ty),
12511251
)
12521252
})
@@ -3595,7 +3595,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
35953595
let where_pred = self.instantiate_binder_with_placeholders(where_pred);
35963596
let failed_pred = self.instantiate_binder_with_fresh_vars(
35973597
expr.span,
3598-
LateBoundRegionConversionTime::FnCall,
3598+
BoundRegionConversionTime::FnCall,
35993599
failed_pred,
36003600
);
36013601

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
13771377
{
13781378
let data = self.instantiate_binder_with_fresh_vars(
13791379
obligation.cause.span,
1380-
infer::LateBoundRegionConversionTime::HigherRankedType,
1380+
infer::BoundRegionConversionTime::HigherRankedType,
13811381
bound_predicate.rebind(data),
13821382
);
13831383
let unnormalized_term = match data.term.unpack() {

compiler/rustc_trait_selection/src/traits/project.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_middle::traits::ImplSourceUserDefinedData;
1818

1919
use crate::errors::InherentProjectionNormalizationOverflow;
2020
use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
21-
use crate::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime};
21+
use crate::infer::{BoundRegionConversionTime, InferCtxt, InferOk};
2222
use crate::traits::error_reporting::TypeErrCtxtExt as _;
2323
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
2424
use crate::traits::select::ProjectionMatchesProjection;
@@ -2319,7 +2319,7 @@ fn confirm_param_env_candidate<'cx, 'tcx>(
23192319

23202320
let cache_entry = infcx.instantiate_binder_with_fresh_vars(
23212321
cause.span,
2322-
LateBoundRegionConversionTime::HigherRankedType,
2322+
BoundRegionConversionTime::HigherRankedType,
23232323
poly_cache_entry,
23242324
);
23252325

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use rustc_ast::Mutability;
1010
use rustc_data_structures::stack::ensure_sufficient_stack;
1111
use rustc_hir::lang_items::LangItem;
12-
use rustc_infer::infer::LateBoundRegionConversionTime::HigherRankedType;
12+
use rustc_infer::infer::BoundRegionConversionTime::HigherRankedType;
1313
use rustc_infer::infer::{DefineOpaqueTypes, InferOk};
1414
use rustc_middle::traits::{BuiltinImplSource, SelectionOutputTypeParameterMismatch};
1515
use rustc_middle::ty::{

compiler/rustc_trait_selection/src/traits/select/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
3232
use rustc_errors::Diagnostic;
3333
use rustc_hir as hir;
3434
use rustc_hir::def_id::DefId;
35+
use rustc_infer::infer::BoundRegionConversionTime;
3536
use rustc_infer::infer::DefineOpaqueTypes;
36-
use rustc_infer::infer::LateBoundRegionConversionTime;
3737
use rustc_infer::traits::TraitObligation;
3838
use rustc_middle::dep_graph::dep_kinds;
3939
use rustc_middle::dep_graph::DepNodeIndex;
@@ -1751,7 +1751,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17511751
let mut nested_obligations = Vec::new();
17521752
let infer_predicate = self.infcx.instantiate_binder_with_fresh_vars(
17531753
obligation.cause.span,
1754-
LateBoundRegionConversionTime::HigherRankedType,
1754+
BoundRegionConversionTime::HigherRankedType,
17551755
env_predicate,
17561756
);
17571757
let infer_projection = if potentially_unnormalized_candidates {

0 commit comments

Comments
 (0)