mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
continue renaming
- `RegionVariableOrigin::~~Late~~BoundRegion` - `~~Late~~BoundRegionConversionTime`
This commit is contained in:
parent
86fa1317a3
commit
dd0739aabe
@ -10,7 +10,7 @@ use rustc_hir as hir;
|
||||
use rustc_hir::def::{CtorKind, Namespace};
|
||||
use rustc_hir::CoroutineKind;
|
||||
use rustc_index::IndexSlice;
|
||||
use rustc_infer::infer::LateBoundRegionConversionTime;
|
||||
use rustc_infer::infer::BoundRegionConversionTime;
|
||||
use rustc_middle::mir::tcx::PlaceTy;
|
||||
use rustc_middle::mir::{
|
||||
AggregateKind, CallSource, ConstOperand, FakeReadCause, Local, LocalInfo, LocalKind, Location,
|
||||
@ -1113,7 +1113,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
||||
&& let ty::Ref(_, _, hir::Mutability::Mut) = args.type_at(0).kind()
|
||||
&& let self_ty = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
fn_call_span,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
tcx.fn_sig(method_did).instantiate(tcx, method_args).input(0),
|
||||
)
|
||||
&& self.infcx.can_eq(self.param_env, ty, self_ty)
|
||||
|
@ -7,7 +7,7 @@
|
||||
//! `RETURN_PLACE` the MIR arguments) are always fully normalized (and
|
||||
//! contain revealed `impl Trait` values).
|
||||
|
||||
use rustc_infer::infer::LateBoundRegionConversionTime;
|
||||
use rustc_infer::infer::BoundRegionConversionTime;
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_span::Span;
|
||||
@ -35,7 +35,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||
.instantiate_canonical_with_fresh_inference_vars(body.span, &user_provided_poly_sig);
|
||||
let user_provided_sig = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
body.span,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
user_provided_sig,
|
||||
);
|
||||
|
||||
|
@ -21,7 +21,7 @@ use rustc_infer::infer::outlives::env::RegionBoundPairs;
|
||||
use rustc_infer::infer::region_constraints::RegionConstraintData;
|
||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use rustc_infer::infer::{
|
||||
InferCtxt, LateBoundRegion, LateBoundRegionConversionTime, NllRegionVariableOrigin,
|
||||
BoundRegion, BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin,
|
||||
};
|
||||
use rustc_middle::mir::tcx::PlaceTy;
|
||||
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
|
||||
@ -1401,10 +1401,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||
};
|
||||
|
||||
self.infcx.next_region_var(
|
||||
LateBoundRegion(
|
||||
BoundRegion(
|
||||
term.source_info.span,
|
||||
br.kind,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
),
|
||||
region_ctxt_fn,
|
||||
)
|
||||
|
@ -7,7 +7,7 @@ use rustc_hir as hir;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_hir_analysis::astconv::AstConv;
|
||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use rustc_infer::infer::{DefineOpaqueTypes, LateBoundRegionConversionTime};
|
||||
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes};
|
||||
use rustc_infer::infer::{InferOk, InferResult};
|
||||
use rustc_macros::{TypeFoldable, TypeVisitable};
|
||||
use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt};
|
||||
@ -558,7 +558,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
// Instantiate (this part of..) S to S', i.e., with fresh variables.
|
||||
self.instantiate_binder_with_fresh_vars(
|
||||
hir_ty.span,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
// (*) binder moved to here
|
||||
supplied_sig.inputs().rebind(supplied_ty),
|
||||
)
|
||||
@ -583,7 +583,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
|
||||
let supplied_output_ty = self.instantiate_binder_with_fresh_vars(
|
||||
decl.output.span(),
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
supplied_sig.output(),
|
||||
);
|
||||
let cause = &self.misc(decl.output.span());
|
||||
|
@ -564,7 +564,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
let span = args.get(i).map(|a| a.span).unwrap_or(expr.span);
|
||||
let input = self.instantiate_binder_with_fresh_vars(
|
||||
span,
|
||||
infer::LateBoundRegionConversionTime::FnCall,
|
||||
infer::BoundRegionConversionTime::FnCall,
|
||||
fn_sig.input(i),
|
||||
);
|
||||
self.require_type_is_sized_deferred(
|
||||
@ -582,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
// with fresh vars.
|
||||
let output = self.instantiate_binder_with_fresh_vars(
|
||||
expr.span,
|
||||
infer::LateBoundRegionConversionTime::FnCall,
|
||||
infer::BoundRegionConversionTime::FnCall,
|
||||
fn_sig.output(),
|
||||
);
|
||||
self.require_type_is_sized_deferred(output, expr.span, traits::SizedReturnType);
|
||||
|
@ -289,7 +289,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
|
||||
) -> Ty<'tcx> {
|
||||
let trait_ref = self.instantiate_binder_with_fresh_vars(
|
||||
span,
|
||||
infer::LateBoundRegionConversionTime::AssocTypeProjection(item_def_id),
|
||||
infer::BoundRegionConversionTime::AssocTypeProjection(item_def_id),
|
||||
poly_trait_ref,
|
||||
);
|
||||
|
||||
|
@ -853,7 +853,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||
self.elaborate_bounds(bounds, |this, poly_trait_ref, item| {
|
||||
let trait_ref = this.instantiate_binder_with_fresh_vars(
|
||||
this.span,
|
||||
infer::LateBoundRegionConversionTime::FnCall,
|
||||
infer::BoundRegionConversionTime::FnCall,
|
||||
poly_trait_ref,
|
||||
);
|
||||
|
||||
@ -971,7 +971,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||
} else {
|
||||
let new_trait_ref = self.instantiate_binder_with_fresh_vars(
|
||||
self.span,
|
||||
infer::LateBoundRegionConversionTime::FnCall,
|
||||
infer::BoundRegionConversionTime::FnCall,
|
||||
bound_trait_ref,
|
||||
);
|
||||
|
||||
|
@ -2768,13 +2768,13 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
|
||||
infer::Autoref(_) => " for autoref".to_string(),
|
||||
infer::Coercion(_) => " for automatic coercion".to_string(),
|
||||
infer::LateBoundRegion(_, br, infer::FnCall) => {
|
||||
infer::BoundRegion(_, br, infer::FnCall) => {
|
||||
format!(" for lifetime parameter {}in function call", br_string(br))
|
||||
}
|
||||
infer::LateBoundRegion(_, br, infer::HigherRankedType) => {
|
||||
infer::BoundRegion(_, br, infer::HigherRankedType) => {
|
||||
format!(" for lifetime parameter {}in generic type", br_string(br))
|
||||
}
|
||||
infer::LateBoundRegion(_, br, infer::AssocTypeProjection(def_id)) => format!(
|
||||
infer::BoundRegion(_, br, infer::AssocTypeProjection(def_id)) => format!(
|
||||
" for lifetime parameter {}in trait containing associated type `{}`",
|
||||
br_string(br),
|
||||
self.tcx.associated_item(def_id).name
|
||||
|
@ -1,7 +1,7 @@
|
||||
pub use self::at::DefineOpaqueTypes;
|
||||
pub use self::freshen::TypeFreshener;
|
||||
pub use self::lexical_region_resolve::RegionResolutionError;
|
||||
pub use self::LateBoundRegionConversionTime::*;
|
||||
pub use self::BoundRegionConversionTime::*;
|
||||
pub use self::RegionVariableOrigin::*;
|
||||
pub use self::SubregionOrigin::*;
|
||||
pub use self::ValuePairs::*;
|
||||
@ -472,9 +472,9 @@ impl<'tcx> SubregionOrigin<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Times when we replace late-bound regions with variables:
|
||||
/// Times when we replace bound regions with existentials:
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum LateBoundRegionConversionTime {
|
||||
pub enum BoundRegionConversionTime {
|
||||
/// when a fn is called
|
||||
FnCall,
|
||||
|
||||
@ -510,9 +510,9 @@ pub enum RegionVariableOrigin {
|
||||
/// Region variables created as the values for early-bound regions.
|
||||
EarlyBoundRegion(Span, Symbol),
|
||||
|
||||
/// Region variables created for bound regions
|
||||
/// in a function or method that is called.
|
||||
LateBoundRegion(Span, ty::BoundRegionKind, LateBoundRegionConversionTime),
|
||||
/// Region variables created when instantiating a binder with
|
||||
/// existential variables, e.g. when calling a function or method.
|
||||
BoundRegion(Span, ty::BoundRegionKind, BoundRegionConversionTime),
|
||||
|
||||
UpvarRegion(ty::UpvarId, Span),
|
||||
|
||||
@ -1456,13 +1456,13 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||
// variables in the current universe.
|
||||
//
|
||||
// Use this method if you'd like to find some substitution of the binder's
|
||||
// variables (e.g. during a method call). If there isn't a [`LateBoundRegionConversionTime`]
|
||||
// variables (e.g. during a method call). If there isn't a [`BoundRegionConversionTime`]
|
||||
// that corresponds to your use case, consider whether or not you should
|
||||
// use [`InferCtxt::instantiate_binder_with_placeholders`] instead.
|
||||
pub fn instantiate_binder_with_fresh_vars<T>(
|
||||
&self,
|
||||
span: Span,
|
||||
lbrct: LateBoundRegionConversionTime,
|
||||
lbrct: BoundRegionConversionTime,
|
||||
value: ty::Binder<'tcx, T>,
|
||||
) -> T
|
||||
where
|
||||
@ -1475,7 +1475,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||
struct ToFreshVars<'a, 'tcx> {
|
||||
infcx: &'a InferCtxt<'tcx>,
|
||||
span: Span,
|
||||
lbrct: LateBoundRegionConversionTime,
|
||||
lbrct: BoundRegionConversionTime,
|
||||
map: FxHashMap<ty::BoundVar, ty::GenericArg<'tcx>>,
|
||||
}
|
||||
|
||||
@ -1485,7 +1485,7 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||
.entry(br.var)
|
||||
.or_insert_with(|| {
|
||||
self.infcx
|
||||
.next_region_var(LateBoundRegion(self.span, br.kind, self.lbrct))
|
||||
.next_region_var(BoundRegion(self.span, br.kind, self.lbrct))
|
||||
.into()
|
||||
})
|
||||
.expect_region()
|
||||
@ -2042,7 +2042,7 @@ impl RegionVariableOrigin {
|
||||
| Autoref(a)
|
||||
| Coercion(a)
|
||||
| EarlyBoundRegion(a, ..)
|
||||
| LateBoundRegion(a, ..)
|
||||
| BoundRegion(a, ..)
|
||||
| UpvarRegion(_, a) => a,
|
||||
Nll(..) => bug!("NLL variable used with `span`"),
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ use rustc_infer::infer::at::ToTrace;
|
||||
use rustc_infer::infer::canonical::CanonicalVarValues;
|
||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use rustc_infer::infer::{
|
||||
DefineOpaqueTypes, InferCtxt, InferOk, LateBoundRegionConversionTime, TyCtxtInferExt,
|
||||
BoundRegionConversionTime, DefineOpaqueTypes, InferCtxt, InferOk, TyCtxtInferExt,
|
||||
};
|
||||
use rustc_infer::traits::query::NoSolution;
|
||||
use rustc_infer::traits::ObligationCause;
|
||||
@ -780,7 +780,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
|
||||
) -> T {
|
||||
self.infcx.instantiate_binder_with_fresh_vars(
|
||||
DUMMY_SP,
|
||||
LateBoundRegionConversionTime::HigherRankedType,
|
||||
BoundRegionConversionTime::HigherRankedType,
|
||||
value,
|
||||
)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_infer::infer::{InferCtxt, LateBoundRegionConversionTime};
|
||||
use rustc_infer::infer::{BoundRegionConversionTime, InferCtxt};
|
||||
use rustc_infer::traits::util::elaborate;
|
||||
use rustc_infer::traits::{Obligation, ObligationCause, PolyTraitObligation};
|
||||
use rustc_middle::ty;
|
||||
@ -53,7 +53,7 @@ pub fn recompute_applicable_impls<'tcx>(
|
||||
|
||||
let param_env_predicate = infcx.instantiate_binder_with_fresh_vars(
|
||||
DUMMY_SP,
|
||||
LateBoundRegionConversionTime::HigherRankedType,
|
||||
BoundRegionConversionTime::HigherRankedType,
|
||||
poly_trait_predicate,
|
||||
);
|
||||
let param_env_trait_ref =
|
||||
|
@ -26,7 +26,7 @@ use rustc_hir::{CoroutineKind, CoroutineSource, Node};
|
||||
use rustc_hir::{Expr, HirId};
|
||||
use rustc_infer::infer::error_reporting::TypeErrCtxt;
|
||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use rustc_infer::infer::{DefineOpaqueTypes, InferOk, LateBoundRegionConversionTime};
|
||||
use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferOk};
|
||||
use rustc_middle::hir::map;
|
||||
use rustc_middle::traits::IsConstable;
|
||||
use rustc_middle::ty::error::TypeError::{self, Sorts};
|
||||
@ -908,7 +908,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
|
||||
let self_ty = self.instantiate_binder_with_fresh_vars(
|
||||
DUMMY_SP,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
trait_pred.self_ty(),
|
||||
);
|
||||
|
||||
@ -1237,7 +1237,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
|
||||
let output = self.instantiate_binder_with_fresh_vars(
|
||||
DUMMY_SP,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
output,
|
||||
);
|
||||
let inputs = inputs
|
||||
@ -1246,7 +1246,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
.map(|ty| {
|
||||
self.instantiate_binder_with_fresh_vars(
|
||||
DUMMY_SP,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
inputs.rebind(*ty),
|
||||
)
|
||||
})
|
||||
@ -3595,7 +3595,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
let where_pred = self.instantiate_binder_with_placeholders(where_pred);
|
||||
let failed_pred = self.instantiate_binder_with_fresh_vars(
|
||||
expr.span,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
failed_pred,
|
||||
);
|
||||
|
||||
|
@ -1377,7 +1377,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
{
|
||||
let data = self.instantiate_binder_with_fresh_vars(
|
||||
obligation.cause.span,
|
||||
infer::LateBoundRegionConversionTime::HigherRankedType,
|
||||
infer::BoundRegionConversionTime::HigherRankedType,
|
||||
bound_predicate.rebind(data),
|
||||
);
|
||||
let unnormalized_term = match data.term.unpack() {
|
||||
|
@ -18,7 +18,7 @@ use rustc_middle::traits::ImplSourceUserDefinedData;
|
||||
|
||||
use crate::errors::InherentProjectionNormalizationOverflow;
|
||||
use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use crate::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime};
|
||||
use crate::infer::{BoundRegionConversionTime, InferCtxt, InferOk};
|
||||
use crate::traits::error_reporting::TypeErrCtxtExt as _;
|
||||
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
|
||||
use crate::traits::select::ProjectionMatchesProjection;
|
||||
@ -2319,7 +2319,7 @@ fn confirm_param_env_candidate<'cx, 'tcx>(
|
||||
|
||||
let cache_entry = infcx.instantiate_binder_with_fresh_vars(
|
||||
cause.span,
|
||||
LateBoundRegionConversionTime::HigherRankedType,
|
||||
BoundRegionConversionTime::HigherRankedType,
|
||||
poly_cache_entry,
|
||||
);
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
use rustc_ast::Mutability;
|
||||
use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_infer::infer::LateBoundRegionConversionTime::HigherRankedType;
|
||||
use rustc_infer::infer::BoundRegionConversionTime::HigherRankedType;
|
||||
use rustc_infer::infer::{DefineOpaqueTypes, InferOk};
|
||||
use rustc_middle::traits::{BuiltinImplSource, SelectionOutputTypeParameterMismatch};
|
||||
use rustc_middle::ty::{
|
||||
|
@ -32,8 +32,8 @@ use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_errors::Diagnostic;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_infer::infer::BoundRegionConversionTime;
|
||||
use rustc_infer::infer::DefineOpaqueTypes;
|
||||
use rustc_infer::infer::LateBoundRegionConversionTime;
|
||||
use rustc_infer::traits::TraitObligation;
|
||||
use rustc_middle::dep_graph::dep_kinds;
|
||||
use rustc_middle::dep_graph::DepNodeIndex;
|
||||
@ -1751,7 +1751,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
let mut nested_obligations = Vec::new();
|
||||
let infer_predicate = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
obligation.cause.span,
|
||||
LateBoundRegionConversionTime::HigherRankedType,
|
||||
BoundRegionConversionTime::HigherRankedType,
|
||||
env_predicate,
|
||||
);
|
||||
let infer_projection = if potentially_unnormalized_candidates {
|
||||
|
Loading…
Reference in New Issue
Block a user