More renaming
This commit is contained in:
parent
eea777c714
commit
1954147834
@ -1979,7 +1979,7 @@ impl Type {
|
||||
walk_bounds(db, &type_.derived(ty.clone()), &bounds, cb);
|
||||
}
|
||||
|
||||
walk_substs(db, type_, &opaque_ty.parameters, cb);
|
||||
walk_substs(db, type_, &opaque_ty.substitution, cb);
|
||||
}
|
||||
TyKind::Placeholder(_) => {
|
||||
if let Some(bounds) = ty.impl_trait_bounds(db) {
|
||||
|
@ -319,7 +319,10 @@ impl HirDisplay for Ty {
|
||||
TyKind::Dyn(predicates) if predicates.len() > 1 => {
|
||||
Cow::Borrowed(predicates.as_ref())
|
||||
}
|
||||
&TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, ref parameters })) => {
|
||||
&TyKind::Alias(AliasTy::Opaque(OpaqueTy {
|
||||
opaque_ty_id,
|
||||
substitution: ref parameters,
|
||||
})) => {
|
||||
let impl_trait_id = f.db.lookup_intern_impl_trait_id(opaque_ty_id.into());
|
||||
if let ImplTraitId::ReturnTypeImplTrait(func, idx) = impl_trait_id {
|
||||
datas =
|
||||
@ -579,7 +582,7 @@ impl HirDisplay for Ty {
|
||||
let data = (*datas)
|
||||
.as_ref()
|
||||
.map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
|
||||
let bounds = data.subst(&opaque_ty.parameters);
|
||||
let bounds = data.subst(&opaque_ty.substitution);
|
||||
write_bounds_like_dyn_trait_with_prefix("impl", &bounds.value, f)?;
|
||||
}
|
||||
ImplTraitId::AsyncBlockTypeImplTrait(..) => {
|
||||
|
@ -66,7 +66,7 @@ pub enum Lifetime {
|
||||
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
|
||||
pub struct OpaqueTy {
|
||||
pub opaque_ty_id: OpaqueTyId,
|
||||
pub parameters: Substs,
|
||||
pub substitution: Substs,
|
||||
}
|
||||
|
||||
/// A "projection" type corresponds to an (unnormalized)
|
||||
@ -903,7 +903,7 @@ impl Ty {
|
||||
let data = (*it)
|
||||
.as_ref()
|
||||
.map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
|
||||
data.subst(&opaque_ty.parameters)
|
||||
data.subst(&opaque_ty.substitution)
|
||||
})
|
||||
}
|
||||
// It always has an parameter for Future::Output type.
|
||||
@ -1059,7 +1059,7 @@ impl TypeWalk for Ty {
|
||||
}
|
||||
}
|
||||
TyKind::Alias(AliasTy::Opaque(o_ty)) => {
|
||||
for t in o_ty.parameters.iter() {
|
||||
for t in o_ty.substitution.iter() {
|
||||
t.walk(f);
|
||||
}
|
||||
}
|
||||
@ -1094,7 +1094,7 @@ impl TypeWalk for Ty {
|
||||
}
|
||||
}
|
||||
TyKind::Alias(AliasTy::Opaque(o_ty)) => {
|
||||
o_ty.parameters.walk_mut_binders(f, binders);
|
||||
o_ty.substitution.walk_mut_binders(f, binders);
|
||||
}
|
||||
_ => {
|
||||
if let Some(substs) = self.substs_mut() {
|
||||
|
@ -230,8 +230,11 @@ impl<'a> TyLoweringContext<'a> {
|
||||
let opaque_ty_id = self.db.intern_impl_trait_id(impl_trait_id).into();
|
||||
let generics = generics(self.db.upcast(), func.into());
|
||||
let parameters = Substs::bound_vars(&generics, self.in_binders);
|
||||
TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, parameters }))
|
||||
.intern(&Interner)
|
||||
TyKind::Alias(AliasTy::Opaque(OpaqueTy {
|
||||
opaque_ty_id,
|
||||
substitution: parameters,
|
||||
}))
|
||||
.intern(&Interner)
|
||||
}
|
||||
ImplTraitLoweringMode::Param => {
|
||||
let idx = self.impl_trait_counter.get();
|
||||
|
@ -87,6 +87,13 @@ impl ToChalk for Ty {
|
||||
.cast(&Interner)
|
||||
.intern(&Interner)
|
||||
}
|
||||
TyKind::Alias(AliasTy::Opaque(opaque_ty)) => {
|
||||
let opaque_ty_id = opaque_ty.opaque_ty_id;
|
||||
let substitution = opaque_ty.substitution.to_chalk(db);
|
||||
chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy { opaque_ty_id, substitution })
|
||||
.cast(&Interner)
|
||||
.intern(&Interner)
|
||||
}
|
||||
TyKind::Placeholder(idx) => idx.to_ty::<Interner>(&Interner),
|
||||
TyKind::BoundVar(idx) => chalk_ir::TyKind::BoundVar(idx).intern(&Interner),
|
||||
TyKind::InferenceVar(..) => panic!("uncanonicalized infer ty"),
|
||||
@ -101,15 +108,6 @@ impl ToChalk for Ty {
|
||||
};
|
||||
chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner)
|
||||
}
|
||||
TyKind::Alias(AliasTy::Opaque(opaque_ty)) => {
|
||||
let opaque_ty_id = opaque_ty.opaque_ty_id;
|
||||
let substitution = opaque_ty.parameters.to_chalk(db);
|
||||
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy {
|
||||
opaque_ty_id,
|
||||
substitution,
|
||||
}))
|
||||
.intern(&Interner)
|
||||
}
|
||||
TyKind::Unknown => chalk_ir::TyKind::Error.intern(&Interner),
|
||||
}
|
||||
}
|
||||
@ -129,7 +127,7 @@ impl ToChalk for Ty {
|
||||
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(opaque_ty)) => {
|
||||
let opaque_ty_id = opaque_ty.opaque_ty_id;
|
||||
let parameters = from_chalk(db, opaque_ty.substitution);
|
||||
TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, parameters }))
|
||||
TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, substitution: parameters }))
|
||||
}
|
||||
chalk_ir::TyKind::Function(chalk_ir::FnPointer {
|
||||
num_binders,
|
||||
|
Loading…
x
Reference in New Issue
Block a user