Skip to content

Commit 29f7292

Browse files
committed
rustc: rename ty_param_{name,owner} to generic_param_*.
1 parent 785ccda commit 29f7292

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/librustc/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
7979
let ty_vars = self.type_variables.borrow();
8080
if let TypeVariableOrigin::TypeParameterDefinition(_, def_id) =
8181
*ty_vars.var_origin(ty_vid) {
82-
self.tcx.ty_param_name(def_id).to_string()
82+
self.tcx.generic_param_name(def_id).to_string()
8383
} else {
8484
ty.to_string()
8585
}

src/librustc/ty/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,7 +2637,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
26372637
}
26382638
}
26392639

2640-
pub fn ty_param_name(self, id: DefId) -> InternedString {
2640+
pub fn generic_param_name(self, id: DefId) -> InternedString {
26412641
let def_key = self.def_key(id);
26422642
match def_key.disambiguated_data.data {
26432643
DefPathData::ImplTrait => {
@@ -2688,7 +2688,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
26882688
}
26892689
}
26902690

2691-
pub fn ty_param_owner(self, id: DefId) -> DefId {
2691+
pub fn generic_param_owner(self, id: DefId) -> DefId {
26922692
let def_key = self.def_key(id);
26932693
match def_key.disambiguated_data.data {
26942694
DefPathData::Trait(_) |

src/librustc/ty/query/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'tcx> QueryDescription<'tcx> for queries::erase_regions_ty<'tcx> {
213213
impl<'tcx> QueryDescription<'tcx> for queries::type_param_predicates<'tcx> {
214214
fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
215215
format!("computing the bounds for type parameter `{}`",
216-
tcx.ty_param_name(def_id))
216+
tcx.generic_param_name(def_id))
217217
}
218218
}
219219

src/librustc/util/ppaux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,10 @@ define_print! {
12671267
define_print! {
12681268
() ty::ParamTy, (self, f, cx) {
12691269
display {
1270-
write!(f, "{}", ty::tls::with(|tcx| tcx.ty_param_name(self.def_id)))
1270+
write!(f, "{}", ty::tls::with(|tcx| tcx.generic_param_name(self.def_id)))
12711271
}
12721272
debug {
1273-
write!(f, "{}/#{}", ty::tls::with(|tcx| tcx.ty_param_name(self.def_id)), self.idx)
1273+
write!(f, "{}/#{}", ty::tls::with(|tcx| tcx.generic_param_name(self.def_id)), self.idx)
12741274
}
12751275
}
12761276
}

src/librustc_typeck/astconv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
11321132
traits::transitive_bounds(tcx, &bounds)
11331133
.filter(|b| self.trait_defines_associated_type_named(b.def_id(), assoc_name));
11341134

1135-
let param_name = tcx.ty_param_name(ty_param_def_id);
1135+
let param_name = tcx.generic_param_name(ty_param_def_id);
11361136
self.one_bound_for_assoc_type(suitable_bounds,
11371137
&param_name.as_str(),
11381138
assoc_name,
@@ -1406,7 +1406,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
14061406
assert_eq!(opt_self_ty, None);
14071407
self.prohibit_generics(&path.segments);
14081408

1409-
let param_owner_def_id = tcx.ty_param_owner(did);
1409+
let param_owner_def_id = tcx.generic_param_owner(did);
14101410
let generics = tcx.generics_of(param_owner_def_id);
14111411
let index = generics.param_def_id_to_index[&did];
14121412
tcx.mk_ty_param(generics.param_at(index, tcx))

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ impl<'a, 'gcx, 'tcx> AstConv<'gcx, 'tcx> for FnCtxt<'a, 'gcx, 'tcx> {
18251825
-> ty::GenericPredicates<'tcx>
18261826
{
18271827
let tcx = self.tcx;
1828-
let item_def_id = tcx.ty_param_owner(def_id);
1828+
let item_def_id = tcx.generic_param_owner(def_id);
18291829
let generics = tcx.generics_of(item_def_id);
18301830
let index = generics.param_def_id_to_index[&def_id];
18311831
ty::GenericPredicates {

src/librustc_typeck/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ fn type_param_predicates<'a, 'tcx>(
244244
// written inline like `<T:Foo>` or in a where clause like
245245
// `where T:Foo`.
246246

247-
let param_owner_def_id = tcx.ty_param_owner(def_id);
247+
let param_owner_def_id = tcx.generic_param_owner(def_id);
248248
let generics = tcx.generics_of(param_owner_def_id);
249249
let index = generics.param_def_id_to_index[&def_id];
250250
let ty = tcx.mk_ty_param(generics.param_at(index, tcx));

0 commit comments

Comments
 (0)