Skip to content

Commit 04fa5d3

Browse files
committed
Remove Ty prefix from Ty{Foreign|Param}
1 parent 6f637da commit 04fa5d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+160
-160
lines changed

src/librustc/hir/def.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ pub enum Def {
5353
Existential(DefId),
5454
/// `type Foo = Bar;`
5555
TyAlias(DefId),
56-
TyForeign(DefId),
56+
Foreign(DefId),
5757
TraitAlias(DefId),
5858
AssociatedTy(DefId),
5959
/// `existential type Foo: Bar;`
6060
AssociatedExistential(DefId),
6161
PrimTy(hir::PrimTy),
62-
TyParam(DefId),
62+
Param(DefId),
6363
SelfTy(Option<DefId> /* trait */, Option<DefId> /* impl */),
6464
ToolMod, // e.g. `rustfmt` in `#[rustfmt::skip]`
6565

@@ -269,10 +269,10 @@ impl Def {
269269
Def::Fn(id) | Def::Mod(id) | Def::Static(id, _) |
270270
Def::Variant(id) | Def::VariantCtor(id, ..) | Def::Enum(id) |
271271
Def::TyAlias(id) | Def::TraitAlias(id) |
272-
Def::AssociatedTy(id) | Def::TyParam(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
272+
Def::AssociatedTy(id) | Def::Param(id) | Def::Struct(id) | Def::StructCtor(id, ..) |
273273
Def::Union(id) | Def::Trait(id) | Def::Method(id) | Def::Const(id) |
274274
Def::AssociatedConst(id) | Def::Macro(id, ..) |
275-
Def::Existential(id) | Def::AssociatedExistential(id) | Def::TyForeign(id) => {
275+
Def::Existential(id) | Def::AssociatedExistential(id) | Def::Foreign(id) => {
276276
id
277277
}
278278

@@ -311,11 +311,11 @@ impl Def {
311311
Def::StructCtor(.., CtorKind::Fictive) => bug!("impossible struct constructor"),
312312
Def::Union(..) => "union",
313313
Def::Trait(..) => "trait",
314-
Def::TyForeign(..) => "foreign type",
314+
Def::Foreign(..) => "foreign type",
315315
Def::Method(..) => "method",
316316
Def::Const(..) => "constant",
317317
Def::AssociatedConst(..) => "associated constant",
318-
Def::TyParam(..) => "type parameter",
318+
Def::Param(..) => "type parameter",
319319
Def::PrimTy(..) => "builtin type",
320320
Def::Local(..) => "local variable",
321321
Def::Upvar(..) => "closure capture",

src/librustc/hir/lowering.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ impl<'a> LoweringContext<'a> {
11831183
}
11841184
ImplTraitContext::Universal(in_band_ty_params) => {
11851185
self.lower_node_id(def_node_id);
1186-
// Add a definition for the in-band TyParam
1186+
// Add a definition for the in-band Param
11871187
let def_index = self
11881188
.resolver
11891189
.definitions()
@@ -1213,7 +1213,7 @@ impl<'a> LoweringContext<'a> {
12131213
None,
12141214
P(hir::Path {
12151215
span,
1216-
def: Def::TyParam(DefId::local(def_index)),
1216+
def: Def::Param(DefId::local(def_index)),
12171217
segments: hir_vec![hir::PathSegment::from_ident(ident)],
12181218
}),
12191219
))
@@ -2352,7 +2352,7 @@ impl<'a> LoweringContext<'a> {
23522352
if path.segments.len() == 1
23532353
&& bound_pred.bound_generic_params.is_empty() =>
23542354
{
2355-
if let Some(Def::TyParam(def_id)) = self.resolver
2355+
if let Some(Def::Param(def_id)) = self.resolver
23562356
.get_resolution(bound_pred.bounded_ty.id)
23572357
.map(|d| d.base_def())
23582358
{

src/librustc/hir/map/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ impl<'hir> Map<'hir> {
453453
match item.node {
454454
ForeignItemKind::Fn(..) => Some(Def::Fn(def_id)),
455455
ForeignItemKind::Static(_, m) => Some(Def::Static(def_id, m)),
456-
ForeignItemKind::Type => Some(Def::TyForeign(def_id)),
456+
ForeignItemKind::Type => Some(Def::Foreign(def_id)),
457457
}
458458
}
459459
NodeTraitItem(item) => {
@@ -499,7 +499,7 @@ impl<'hir> Map<'hir> {
499499
NodeGenericParam(param) => {
500500
Some(match param.kind {
501501
GenericParamKind::Lifetime { .. } => Def::Local(param.id),
502-
GenericParamKind::Type { .. } => Def::TyParam(self.local_def_id(param.id)),
502+
GenericParamKind::Type { .. } => Def::Param(self.local_def_id(param.id)),
503503
})
504504
}
505505
}

src/librustc/ich/impls_hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,9 +1010,9 @@ impl_stable_hash_for!(enum hir::def::Def {
10101010
AssociatedTy(def_id),
10111011
AssociatedExistential(def_id),
10121012
PrimTy(prim_ty),
1013-
TyParam(def_id),
1013+
Param(def_id),
10141014
SelfTy(trait_def_id, impl_def_id),
1015-
TyForeign(def_id),
1015+
Foreign(def_id),
10161016
Fn(def_id),
10171017
Const(def_id),
10181018
Static(def_id, is_mutbl),

src/librustc/ich/impls_ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,10 +874,10 @@ for ty::TyKind<'gcx>
874874
def_id.hash_stable(hcx, hasher);
875875
substs.hash_stable(hcx, hasher);
876876
}
877-
TyParam(param_ty) => {
877+
Param(param_ty) => {
878878
param_ty.hash_stable(hcx, hasher);
879879
}
880-
TyForeign(def_id) => {
880+
Foreign(def_id) => {
881881
def_id.hash_stable(hcx, hasher);
882882
}
883883
Infer(infer_ty) => {

src/librustc/infer/canonical/canonicalizer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
283283
| ty::Never
284284
| ty::Tuple(..)
285285
| ty::Projection(..)
286-
| ty::TyForeign(..)
287-
| ty::TyParam(..)
286+
| ty::Foreign(..)
287+
| ty::Param(..)
288288
| ty::Anon(..) => {
289289
if t.flags.intersects(self.needs_canonical_flags) {
290290
t.super_fold_with(self)

src/librustc/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11231123
let type_param = generics.type_param(param, self.tcx);
11241124
let hir = &self.tcx.hir;
11251125
hir.as_local_node_id(type_param.def_id).map(|id| {
1126-
// Get the `hir::TyParam` to verify whether it already has any bounds.
1126+
// Get the `hir::Param` to verify whether it already has any bounds.
11271127
// We do this to avoid suggesting code that ends up as `T: 'a'b`,
11281128
// instead we suggest `T: 'a + 'b` in that case.
11291129
let mut has_bounds = false;

src/librustc/infer/freshen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx> {
193193
ty::Never |
194194
ty::Tuple(..) |
195195
ty::Projection(..) |
196-
ty::TyForeign(..) |
197-
ty::TyParam(..) |
196+
ty::Foreign(..) |
197+
ty::Param(..) |
198198
ty::Closure(..) |
199199
ty::GeneratorWitness(..) |
200200
ty::Anon(..) => {

src/librustc/infer/outlives/obligations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ where
450450

451451
fn type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> {
452452
match ty.sty {
453-
ty::TyParam(p) => self.param_bound(p),
453+
ty::Param(p) => self.param_bound(p),
454454
ty::Projection(data) => {
455455
let declared_bounds = self.projection_declared_bounds(data);
456456
self.projection_bound(declared_bounds, data)

src/librustc/middle/resolve_lifetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ fn object_lifetime_defaults_for_item(
13261326
_ => continue,
13271327
};
13281328

1329-
if def == Def::TyParam(param_def_id) {
1329+
if def == Def::Param(param_def_id) {
13301330
add_bounds(&mut set, &data.bounds);
13311331
}
13321332
}

0 commit comments

Comments
 (0)