Skip to content

Commit 233298c

Browse files
committed
Rename TypeParams to TypeArgs
1 parent 1241177 commit 233298c

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/analyze/basic_block.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl<'tcx, 'ctx> Analyzer<'tcx, 'ctx> {
219219
.into_iter()
220220
.map(|ty| rty::RefinedType::unrefined(ty.vacuous()));
221221

222-
let params: IndexVec<_, _> = args
222+
let rty_args: IndexVec<_, _> = args
223223
.types()
224224
.map(|ty| {
225225
self.ctx
@@ -230,15 +230,15 @@ impl<'tcx, 'ctx> Analyzer<'tcx, 'ctx> {
230230
for (field_pty, mut variant_rty) in
231231
field_tys.clone().into_iter().zip(variant_rtys)
232232
{
233-
variant_rty.instantiate_ty_params(params.clone());
233+
variant_rty.instantiate_ty_params(rty_args.clone());
234234
let cs = self
235235
.env
236236
.relate_sub_refined_type(&field_pty.into(), &variant_rty.boxed());
237237
self.ctx.extend_clauses(cs);
238238
}
239239

240-
let sort_args: Vec<_> = params.iter().map(|rty| rty.ty.to_sort()).collect();
241-
let ty = rty::EnumType::new(ty_sym.clone(), params).into();
240+
let sort_args: Vec<_> = rty_args.iter().map(|rty| rty.ty.to_sort()).collect();
241+
let ty = rty::EnumType::new(ty_sym.clone(), rty_args).into();
242242

243243
let mut builder = PlaceTypeBuilder::default();
244244
let mut field_terms = Vec::new();

src/refine/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ impl Env {
930930
.field_tys()
931931
.map(|ty| rty::RefinedType::unrefined(ty.clone().vacuous()).boxed());
932932
let got_tys = field_tys.iter().map(|ty| ty.clone().into());
933-
rty::unify_tys_params(expected_tys, got_tys).into_params(def.ty_params, |_| {
933+
rty::unify_tys_params(expected_tys, got_tys).into_args(def.ty_params, |_| {
934934
panic!("var_type: should unify all params")
935935
})
936936
};

src/rty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mod subtyping;
5555
pub use subtyping::{relate_sub_closed_type, ClauseScope, Subtyping};
5656

5757
mod params;
58-
pub use params::{TypeParamIdx, TypeParamSubst, TypeParams};
58+
pub use params::{TypeArgs, TypeParamIdx, TypeParamSubst};
5959

6060
rustc_index::newtype_index! {
6161
/// An index representing function parameter.
@@ -487,7 +487,7 @@ where
487487
}
488488

489489
impl<T> EnumType<T> {
490-
pub fn new(symbol: chc::DatatypeSymbol, args: TypeParams<T>) -> Self {
490+
pub fn new(symbol: chc::DatatypeSymbol, args: TypeArgs<T>) -> Self {
491491
EnumType { symbol, args }
492492
}
493493

@@ -1372,7 +1372,7 @@ impl<FV> RefinedType<FV> {
13721372
}
13731373
}
13741374

1375-
pub fn instantiate_ty_params(&mut self, params: TypeParams<FV>)
1375+
pub fn instantiate_ty_params(&mut self, params: TypeArgs<FV>)
13761376
where
13771377
FV: chc::Var,
13781378
{

src/rty/params.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl TypeParamIdx {
3939
}
4040
}
4141

42-
pub type TypeParams<T> = IndexVec<TypeParamIdx, RefinedType<T>>;
42+
pub type TypeArgs<T> = IndexVec<TypeParamIdx, RefinedType<T>>;
4343

4444
/// A substitution for type parameters that maps type parameters to refinement types.
4545
#[derive(Debug, Clone)]
@@ -55,8 +55,8 @@ impl<T> Default for TypeParamSubst<T> {
5555
}
5656
}
5757

58-
impl<T> From<TypeParams<T>> for TypeParamSubst<T> {
59-
fn from(params: TypeParams<T>) -> Self {
58+
impl<T> From<TypeArgs<T>> for TypeParamSubst<T> {
59+
fn from(params: TypeArgs<T>) -> Self {
6060
let subst = params.into_iter_enumerated().collect();
6161
Self { subst }
6262
}
@@ -98,20 +98,20 @@ impl<T> TypeParamSubst<T> {
9898
}
9999
}
100100

101-
pub fn into_params<F>(mut self, expected_len: usize, mut default: F) -> TypeParams<T>
101+
pub fn into_args<F>(mut self, expected_len: usize, mut default: F) -> TypeArgs<T>
102102
where
103103
T: chc::Var,
104104
F: FnMut(TypeParamIdx) -> RefinedType<T>,
105105
{
106-
let mut params = TypeParams::new();
106+
let mut args = TypeArgs::new();
107107
for idx in 0..expected_len {
108108
let ty = self
109109
.subst
110110
.remove(&idx.into())
111111
.unwrap_or_else(|| default(idx.into()));
112-
params.push(ty);
112+
args.push(ty);
113113
}
114-
params
114+
args
115115
}
116116

117117
pub fn strip_refinement(self) -> TypeParamSubst<Closed> {

0 commit comments

Comments
 (0)