Skip to content

Commit 6f637da

Browse files
committed
Remove Ty prefix from Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
1 parent d37cee3 commit 6f637da

File tree

157 files changed

+1430
-1430
lines changed

Some content is hidden

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

157 files changed

+1430
-1430
lines changed

src/librustc/ich/impls_ty.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,8 @@ for ty::TyKind<'gcx>
809809
TyBool |
810810
TyChar |
811811
TyStr |
812-
TyError |
813-
TyNever => {
812+
Error |
813+
Never => {
814814
// Nothing more to hash.
815815
}
816816
TyInt(int_ty) => {
@@ -822,55 +822,55 @@ for ty::TyKind<'gcx>
822822
TyFloat(float_ty) => {
823823
float_ty.hash_stable(hcx, hasher);
824824
}
825-
TyAdt(adt_def, substs) => {
825+
Adt(adt_def, substs) => {
826826
adt_def.hash_stable(hcx, hasher);
827827
substs.hash_stable(hcx, hasher);
828828
}
829-
TyArray(inner_ty, len) => {
829+
Array(inner_ty, len) => {
830830
inner_ty.hash_stable(hcx, hasher);
831831
len.hash_stable(hcx, hasher);
832832
}
833-
TySlice(inner_ty) => {
833+
Slice(inner_ty) => {
834834
inner_ty.hash_stable(hcx, hasher);
835835
}
836-
TyRawPtr(pointee_ty) => {
836+
RawPtr(pointee_ty) => {
837837
pointee_ty.hash_stable(hcx, hasher);
838838
}
839-
TyRef(region, pointee_ty, mutbl) => {
839+
Ref(region, pointee_ty, mutbl) => {
840840
region.hash_stable(hcx, hasher);
841841
pointee_ty.hash_stable(hcx, hasher);
842842
mutbl.hash_stable(hcx, hasher);
843843
}
844-
TyFnDef(def_id, substs) => {
844+
FnDef(def_id, substs) => {
845845
def_id.hash_stable(hcx, hasher);
846846
substs.hash_stable(hcx, hasher);
847847
}
848-
TyFnPtr(ref sig) => {
848+
FnPtr(ref sig) => {
849849
sig.hash_stable(hcx, hasher);
850850
}
851-
TyDynamic(ref existential_predicates, region) => {
851+
Dynamic(ref existential_predicates, region) => {
852852
existential_predicates.hash_stable(hcx, hasher);
853853
region.hash_stable(hcx, hasher);
854854
}
855-
TyClosure(def_id, closure_substs) => {
855+
Closure(def_id, closure_substs) => {
856856
def_id.hash_stable(hcx, hasher);
857857
closure_substs.hash_stable(hcx, hasher);
858858
}
859-
TyGenerator(def_id, generator_substs, movability) => {
859+
Generator(def_id, generator_substs, movability) => {
860860
def_id.hash_stable(hcx, hasher);
861861
generator_substs.hash_stable(hcx, hasher);
862862
movability.hash_stable(hcx, hasher);
863863
}
864-
TyGeneratorWitness(types) => {
864+
GeneratorWitness(types) => {
865865
types.hash_stable(hcx, hasher)
866866
}
867-
TyTuple(inner_tys) => {
867+
Tuple(inner_tys) => {
868868
inner_tys.hash_stable(hcx, hasher);
869869
}
870-
TyProjection(ref projection_ty) => {
870+
Projection(ref projection_ty) => {
871871
projection_ty.hash_stable(hcx, hasher);
872872
}
873-
TyAnon(def_id, substs) => {
873+
Anon(def_id, substs) => {
874874
def_id.hash_stable(hcx, hasher);
875875
substs.hash_stable(hcx, hasher);
876876
}
@@ -880,7 +880,7 @@ for ty::TyKind<'gcx>
880880
TyForeign(def_id) => {
881881
def_id.hash_stable(hcx, hasher);
882882
}
883-
TyInfer(infer_ty) => {
883+
Infer(infer_ty) => {
884884
infer_ty.hash_stable(hcx, hasher);
885885
}
886886
}

src/librustc/infer/anon_types/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx>
592592

593593
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
594594
match ty.sty {
595-
ty::TyClosure(def_id, substs) => {
595+
ty::Closure(def_id, substs) => {
596596
// I am a horrible monster and I pray for death. When
597597
// we encounter a closure here, it is always a closure
598598
// from within the function that we are currently
@@ -655,7 +655,7 @@ impl<'a, 'gcx, 'tcx> Instantiator<'a, 'gcx, 'tcx> {
655655
tcx,
656656
reg_op: |reg| reg,
657657
fldop: |ty| {
658-
if let ty::TyAnon(def_id, substs) = ty.sty {
658+
if let ty::Anon(def_id, substs) = ty.sty {
659659
// Check that this is `impl Trait` type is
660660
// declared by `parent_def_id` -- i.e., one whose
661661
// value we are inferring. At present, this is
@@ -679,7 +679,7 @@ impl<'a, 'gcx, 'tcx> Instantiator<'a, 'gcx, 'tcx> {
679679
// ```
680680
//
681681
// Here, the return type of `foo` references a
682-
// `TyAnon` indeed, but not one whose value is
682+
// `Anon` indeed, but not one whose value is
683683
// presently being inferred. You can get into a
684684
// similar situation with closure return types
685685
// today:
@@ -755,11 +755,11 @@ impl<'a, 'gcx, 'tcx> Instantiator<'a, 'gcx, 'tcx> {
755755
let tcx = infcx.tcx;
756756

757757
debug!(
758-
"instantiate_anon_types: TyAnon(def_id={:?}, substs={:?})",
758+
"instantiate_anon_types: Anon(def_id={:?}, substs={:?})",
759759
def_id, substs
760760
);
761761

762-
// Use the same type variable if the exact same TyAnon appears more
762+
// Use the same type variable if the exact same Anon appears more
763763
// than once in the return type (e.g. if it's passed to a type alias).
764764
if let Some(anon_defn) = self.anon_types.get(&def_id) {
765765
return anon_defn.concrete_ty;
@@ -805,7 +805,7 @@ impl<'a, 'gcx, 'tcx> Instantiator<'a, 'gcx, 'tcx> {
805805

806806
for predicate in bounds.predicates {
807807
// Change the predicate to refer to the type variable,
808-
// which will be the concrete type, instead of the TyAnon.
808+
// which will be the concrete type, instead of the Anon.
809809
// This also instantiates nested `impl Trait`.
810810
let predicate = self.instantiate_anon_types_in_map(&predicate);
811811

src/librustc/infer/canonical/canonicalizer.rs

+23-23
Original file line numberDiff line numberDiff line change
@@ -246,46 +246,46 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
246246

247247
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
248248
match t.sty {
249-
ty::TyInfer(ty::TyVar(_)) => self.canonicalize_ty_var(CanonicalTyVarKind::General, t),
249+
ty::Infer(ty::TyVar(_)) => self.canonicalize_ty_var(CanonicalTyVarKind::General, t),
250250

251-
ty::TyInfer(ty::IntVar(_)) => self.canonicalize_ty_var(CanonicalTyVarKind::Int, t),
251+
ty::Infer(ty::IntVar(_)) => self.canonicalize_ty_var(CanonicalTyVarKind::Int, t),
252252

253-
ty::TyInfer(ty::FloatVar(_)) => self.canonicalize_ty_var(CanonicalTyVarKind::Float, t),
253+
ty::Infer(ty::FloatVar(_)) => self.canonicalize_ty_var(CanonicalTyVarKind::Float, t),
254254

255-
ty::TyInfer(ty::FreshTy(_))
256-
| ty::TyInfer(ty::FreshIntTy(_))
257-
| ty::TyInfer(ty::FreshFloatTy(_)) => {
255+
ty::Infer(ty::FreshTy(_))
256+
| ty::Infer(ty::FreshIntTy(_))
257+
| ty::Infer(ty::FreshFloatTy(_)) => {
258258
bug!("encountered a fresh type during canonicalization")
259259
}
260260

261-
ty::TyInfer(ty::CanonicalTy(_)) => {
261+
ty::Infer(ty::CanonicalTy(_)) => {
262262
bug!("encountered a canonical type during canonicalization")
263263
}
264264

265-
ty::TyClosure(..)
266-
| ty::TyGenerator(..)
267-
| ty::TyGeneratorWitness(..)
265+
ty::Closure(..)
266+
| ty::Generator(..)
267+
| ty::GeneratorWitness(..)
268268
| ty::TyBool
269269
| ty::TyChar
270270
| ty::TyInt(..)
271271
| ty::TyUint(..)
272272
| ty::TyFloat(..)
273-
| ty::TyAdt(..)
273+
| ty::Adt(..)
274274
| ty::TyStr
275-
| ty::TyError
276-
| ty::TyArray(..)
277-
| ty::TySlice(..)
278-
| ty::TyRawPtr(..)
279-
| ty::TyRef(..)
280-
| ty::TyFnDef(..)
281-
| ty::TyFnPtr(_)
282-
| ty::TyDynamic(..)
283-
| ty::TyNever
284-
| ty::TyTuple(..)
285-
| ty::TyProjection(..)
275+
| ty::Error
276+
| ty::Array(..)
277+
| ty::Slice(..)
278+
| ty::RawPtr(..)
279+
| ty::Ref(..)
280+
| ty::FnDef(..)
281+
| ty::FnPtr(_)
282+
| ty::Dynamic(..)
283+
| ty::Never
284+
| ty::Tuple(..)
285+
| ty::Projection(..)
286286
| ty::TyForeign(..)
287287
| ty::TyParam(..)
288-
| ty::TyAnon(..) => {
288+
| ty::Anon(..) => {
289289
if t.flags.intersects(self.needs_canonical_flags) {
290290
t.super_fold_with(self)
291291
} else {

src/librustc/infer/canonical/query_result.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
421421
match result_value.unpack() {
422422
UnpackedKind::Type(result_value) => {
423423
// e.g., here `result_value` might be `?0` in the example above...
424-
if let ty::TyInfer(ty::InferTy::CanonicalTy(index)) = result_value.sty {
424+
if let ty::Infer(ty::InferTy::CanonicalTy(index)) = result_value.sty {
425425
// in which case we would set `canonical_vars[0]` to `Some(?U)`.
426426
opt_values[index] = Some(*original_value);
427427
}

src/librustc/infer/canonical/substitute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for CanonicalVarValuesSubst<'cx, 'g
8585

8686
fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
8787
match t.sty {
88-
ty::TyInfer(ty::InferTy::CanonicalTy(c)) => {
88+
ty::Infer(ty::InferTy::CanonicalTy(c)) => {
8989
match self.var_values.var_values[c].unpack() {
9090
UnpackedKind::Type(ty) => ty,
9191
r => bug!("{:?} is a type but value is {:?}", c, r),

src/librustc/infer/combine.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -76,44 +76,44 @@ impl<'infcx, 'gcx, 'tcx> InferCtxt<'infcx, 'gcx, 'tcx> {
7676

7777
match (&a.sty, &b.sty) {
7878
// Relate integral variables to other types
79-
(&ty::TyInfer(ty::IntVar(a_id)), &ty::TyInfer(ty::IntVar(b_id))) => {
79+
(&ty::Infer(ty::IntVar(a_id)), &ty::Infer(ty::IntVar(b_id))) => {
8080
self.int_unification_table
8181
.borrow_mut()
8282
.unify_var_var(a_id, b_id)
8383
.map_err(|e| int_unification_error(a_is_expected, e))?;
8484
Ok(a)
8585
}
86-
(&ty::TyInfer(ty::IntVar(v_id)), &ty::TyInt(v)) => {
86+
(&ty::Infer(ty::IntVar(v_id)), &ty::TyInt(v)) => {
8787
self.unify_integral_variable(a_is_expected, v_id, IntType(v))
8888
}
89-
(&ty::TyInt(v), &ty::TyInfer(ty::IntVar(v_id))) => {
89+
(&ty::TyInt(v), &ty::Infer(ty::IntVar(v_id))) => {
9090
self.unify_integral_variable(!a_is_expected, v_id, IntType(v))
9191
}
92-
(&ty::TyInfer(ty::IntVar(v_id)), &ty::TyUint(v)) => {
92+
(&ty::Infer(ty::IntVar(v_id)), &ty::TyUint(v)) => {
9393
self.unify_integral_variable(a_is_expected, v_id, UintType(v))
9494
}
95-
(&ty::TyUint(v), &ty::TyInfer(ty::IntVar(v_id))) => {
95+
(&ty::TyUint(v), &ty::Infer(ty::IntVar(v_id))) => {
9696
self.unify_integral_variable(!a_is_expected, v_id, UintType(v))
9797
}
9898

9999
// Relate floating-point variables to other types
100-
(&ty::TyInfer(ty::FloatVar(a_id)), &ty::TyInfer(ty::FloatVar(b_id))) => {
100+
(&ty::Infer(ty::FloatVar(a_id)), &ty::Infer(ty::FloatVar(b_id))) => {
101101
self.float_unification_table
102102
.borrow_mut()
103103
.unify_var_var(a_id, b_id)
104104
.map_err(|e| float_unification_error(relation.a_is_expected(), e))?;
105105
Ok(a)
106106
}
107-
(&ty::TyInfer(ty::FloatVar(v_id)), &ty::TyFloat(v)) => {
107+
(&ty::Infer(ty::FloatVar(v_id)), &ty::TyFloat(v)) => {
108108
self.unify_float_variable(a_is_expected, v_id, v)
109109
}
110-
(&ty::TyFloat(v), &ty::TyInfer(ty::FloatVar(v_id))) => {
110+
(&ty::TyFloat(v), &ty::Infer(ty::FloatVar(v_id))) => {
111111
self.unify_float_variable(!a_is_expected, v_id, v)
112112
}
113113

114114
// All other cases of inference are errors
115-
(&ty::TyInfer(_), _) |
116-
(_, &ty::TyInfer(_)) => {
115+
(&ty::Infer(_), _) |
116+
(_, &ty::Infer(_)) => {
117117
Err(TypeError::Sorts(ty::relate::expected_found(relation, &a, &b)))
118118
}
119119

@@ -393,7 +393,7 @@ impl<'cx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> for Generalizer<'cx, 'gcx, '
393393
// subtyping. This is basically our "occurs check", preventing
394394
// us from creating infinitely sized types.
395395
match t.sty {
396-
ty::TyInfer(ty::TyVar(vid)) => {
396+
ty::Infer(ty::TyVar(vid)) => {
397397
let mut variables = self.infcx.type_variables.borrow_mut();
398398
let vid = variables.root_var(vid);
399399
let sub_vid = variables.sub_root_var(vid);
@@ -433,8 +433,8 @@ impl<'cx, 'gcx, 'tcx> TypeRelation<'cx, 'gcx, 'tcx> for Generalizer<'cx, 'gcx, '
433433
}
434434
}
435435
}
436-
ty::TyInfer(ty::IntVar(_)) |
437-
ty::TyInfer(ty::FloatVar(_)) => {
436+
ty::Infer(ty::IntVar(_)) |
437+
ty::Infer(ty::FloatVar(_)) => {
438438
// No matter what mode we are in,
439439
// integer/floating-point types must be equal to be
440440
// relatable.

src/librustc/infer/equate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ impl<'combine, 'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx>
7575
let a = infcx.type_variables.borrow_mut().replace_if_possible(a);
7676
let b = infcx.type_variables.borrow_mut().replace_if_possible(b);
7777
match (&a.sty, &b.sty) {
78-
(&ty::TyInfer(TyVar(a_id)), &ty::TyInfer(TyVar(b_id))) => {
78+
(&ty::Infer(TyVar(a_id)), &ty::Infer(TyVar(b_id))) => {
7979
infcx.type_variables.borrow_mut().equate(a_id, b_id);
8080
Ok(a)
8181
}
8282

83-
(&ty::TyInfer(TyVar(a_id)), _) => {
83+
(&ty::Infer(TyVar(a_id)), _) => {
8484
self.fields.instantiate(b, RelationDir::EqTo, a_id, self.a_is_expected)?;
8585
Ok(a)
8686
}
8787

88-
(_, &ty::TyInfer(TyVar(b_id))) => {
88+
(_, &ty::Infer(TyVar(b_id))) => {
8989
self.fields.instantiate(a, RelationDir::EqTo, b_id, self.a_is_expected)?;
9090
Ok(a)
9191
}

0 commit comments

Comments
 (0)