Rollup merge of #117583 - compiler-errors:placeholderconst-lifetime, r=cjgillot

Remove `'tcx` lifetime on `PlaceholderConst`

The `'tcx` lifetime is not needed for anything, so this is a continuation of #117139.
This commit is contained in:
Matthias Krüger 2023-11-04 21:38:30 +01:00 committed by GitHub
commit 8912a2b551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

View File

@ -222,7 +222,7 @@ pub enum CanonicalVarKind<'tcx> {
Effect, Effect,
/// A "placeholder" that represents "any const". /// A "placeholder" that represents "any const".
PlaceholderConst(ty::PlaceholderConst<'tcx>, Ty<'tcx>), PlaceholderConst(ty::PlaceholderConst, Ty<'tcx>),
} }
impl<'tcx> CanonicalVarKind<'tcx> { impl<'tcx> CanonicalVarKind<'tcx> {

View File

@ -84,7 +84,7 @@ pub fn new_bound(
#[inline] #[inline]
pub fn new_placeholder( pub fn new_placeholder(
tcx: TyCtxt<'tcx>, tcx: TyCtxt<'tcx>,
placeholder: ty::PlaceholderConst<'tcx>, placeholder: ty::PlaceholderConst,
ty: Ty<'tcx>, ty: Ty<'tcx>,
) -> Const<'tcx> { ) -> Const<'tcx> {
Const::new(tcx, ty::ConstKind::Placeholder(placeholder), ty) Const::new(tcx, ty::ConstKind::Placeholder(placeholder), ty)

View File

@ -106,7 +106,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
type Const = ty::Const<'tcx>; type Const = ty::Const<'tcx>;
type InferConst = ty::InferConst; type InferConst = ty::InferConst;
type AliasConst = ty::UnevaluatedConst<'tcx>; type AliasConst = ty::UnevaluatedConst<'tcx>;
type PlaceholderConst = ty::PlaceholderConst<'tcx>; type PlaceholderConst = ty::PlaceholderConst;
type ParamConst = ty::ParamConst; type ParamConst = ty::ParamConst;
type BoundConst = ty::BoundVar; type BoundConst = ty::BoundVar;
type ValueConst = ty::ValTree<'tcx>; type ValueConst = ty::ValTree<'tcx>;

View File

@ -1527,7 +1527,7 @@ pub struct BoundConst<'tcx> {
pub ty: Ty<'tcx>, pub ty: Ty<'tcx>,
} }
pub type PlaceholderConst<'tcx> = Placeholder<BoundVar>; pub type PlaceholderConst = Placeholder<BoundVar>;
/// When type checking, we use the `ParamEnv` to track /// When type checking, we use the `ParamEnv` to track
/// details about the set of where-clauses that are in scope at this /// details about the set of where-clauses that are in scope at this

View File

@ -783,7 +783,7 @@ pub struct BoundVarReplacer<'me, 'tcx> {
// the `var` (but we *could* bring that into scope if we were to track them as we pass them). // the `var` (but we *could* bring that into scope if we were to track them as we pass them).
mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>, mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>, mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
mapped_consts: BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar>, mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
// The current depth relative to *this* folding, *not* the entire normalization. In other words, // The current depth relative to *this* folding, *not* the entire normalization. In other words,
// the depth of binders we've passed here. // the depth of binders we've passed here.
current_index: ty::DebruijnIndex, current_index: ty::DebruijnIndex,
@ -843,11 +843,11 @@ pub fn replace_bound_vars<T: TypeFoldable<TyCtxt<'tcx>>>(
T, T,
BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>, BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
BTreeMap<ty::PlaceholderType, ty::BoundTy>, BTreeMap<ty::PlaceholderType, ty::BoundTy>,
BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar>, BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
) { ) {
let mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion> = BTreeMap::new(); let mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion> = BTreeMap::new();
let mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy> = BTreeMap::new(); let mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy> = BTreeMap::new();
let mapped_consts: BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar> = BTreeMap::new(); let mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar> = BTreeMap::new();
let mut replacer = BoundVarReplacer { let mut replacer = BoundVarReplacer {
infcx, infcx,
@ -966,7 +966,7 @@ pub struct PlaceholderReplacer<'me, 'tcx> {
infcx: &'me InferCtxt<'tcx>, infcx: &'me InferCtxt<'tcx>,
mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>, mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>, mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
mapped_consts: BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar>, mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
universe_indices: &'me [Option<ty::UniverseIndex>], universe_indices: &'me [Option<ty::UniverseIndex>],
current_index: ty::DebruijnIndex, current_index: ty::DebruijnIndex,
} }
@ -976,7 +976,7 @@ pub fn replace_placeholders<T: TypeFoldable<TyCtxt<'tcx>>>(
infcx: &'me InferCtxt<'tcx>, infcx: &'me InferCtxt<'tcx>,
mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>, mapped_regions: BTreeMap<ty::PlaceholderRegion, ty::BoundRegion>,
mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>, mapped_types: BTreeMap<ty::PlaceholderType, ty::BoundTy>,
mapped_consts: BTreeMap<ty::PlaceholderConst<'tcx>, ty::BoundVar>, mapped_consts: BTreeMap<ty::PlaceholderConst, ty::BoundVar>,
universe_indices: &'me [Option<ty::UniverseIndex>], universe_indices: &'me [Option<ty::UniverseIndex>],
value: T, value: T,
) -> T { ) -> T {