Skip to content

Commit 08f3685

Browse files
committed
Remove unnecessary TyKind::s
1 parent 8a5dccd commit 08f3685

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

src/librustc/middle/dead.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
236236
self.handle_field_access(&lhs, expr.id);
237237
}
238238
hir::ExprKind::Struct(_, ref fields, _) => {
239-
if let ty::TyKind::Adt(ref adt, _) = self.tables.expr_ty(expr).sty {
239+
if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).sty {
240240
self.mark_as_used_if_union(adt, fields);
241241
}
242242
}

src/librustc/traits/error_reporting.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
802802
let expected = match expected_trait_ref.skip_binder().substs.type_at(1).sty {
803803
ty::Tuple(ref tys) => tys.iter()
804804
.map(|t| match t.sty {
805-
ty::TyKind::Tuple(ref tys) => ArgKind::Tuple(
805+
ty::Tuple(ref tys) => ArgKind::Tuple(
806806
Some(span),
807807
tys.iter()
808808
.map(|ty| ("_".to_owned(), ty.sty.to_string()))
@@ -899,7 +899,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
899899
let mut trait_type = trait_ref.self_ty();
900900

901901
for refs_remaining in 0..refs_number {
902-
if let ty::TyKind::Ref(_, t_type, _) = trait_type.sty {
902+
if let ty::Ref(_, t_type, _) = trait_type.sty {
903903
trait_type = t_type;
904904

905905
let substs = self.tcx.mk_substs_trait(trait_type, &[]);

src/librustc/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
503503
!impl_generics.region_param(ebr, self).pure_wrt_drop
504504
}
505505
UnpackedKind::Type(&ty::TyS {
506-
sty: ty::TyKind::Param(ref pt), ..
506+
sty: ty::Param(ref pt), ..
507507
}) => {
508508
!impl_generics.type_param(pt, self).pure_wrt_drop
509509
}

src/librustc_borrowck/borrowck/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
697697
Some(nl.to_string()),
698698
Origin::Ast);
699699
let need_note = match lp.ty.sty {
700-
ty::TyKind::Closure(id, _) => {
700+
ty::Closure(id, _) => {
701701
let node_id = self.tcx.hir.as_local_node_id(id).unwrap();
702702
let hir_id = self.tcx.hir.node_to_hir_id(node_id);
703703
if let Some((span, name)) = self.tables.closure_kind_origins().get(hir_id) {

src/librustc_mir/borrow_check/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
134134

135135
if let Some(ty) = self.retrieve_type_for_place(place) {
136136
let needs_note = match ty.sty {
137-
ty::TyKind::Closure(id, _) => {
137+
ty::Closure(id, _) => {
138138
let tables = self.tcx.typeck_tables_of(id);
139139
let node_id = self.tcx.hir.as_local_node_id(id).unwrap();
140140
let hir_id = self.tcx.hir.node_to_hir_id(node_id);

src/librustc_typeck/check/_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
5353
PatKind::Lit(ref lt) => {
5454
let ty = self.check_expr(lt);
5555
match ty.sty {
56-
ty::TyKind::Ref(..) => false,
56+
ty::Ref(..) => false,
5757
_ => true,
5858
}
5959
}
@@ -84,7 +84,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
8484
expected = loop {
8585
debug!("inspecting {:?} with type {:?}", exp_ty, exp_ty.sty);
8686
match exp_ty.sty {
87-
ty::TyKind::Ref(_, inner_ty, inner_mutability) => {
87+
ty::Ref(_, inner_ty, inner_mutability) => {
8888
debug!("current discriminant is Ref, inserting implicit deref");
8989
// Preserve the reference type. We'll need it later during HAIR lowering.
9090
pat_adjustments.push(exp_ty);

src/librustc_typeck/check/cast.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
477477
(RPtr(p), Int(_)) |
478478
(RPtr(p), Float) => {
479479
match p.ty.sty {
480-
ty::TyKind::Int(_) |
481-
ty::TyKind::Uint(_) |
482-
ty::TyKind::Float(_) => {
480+
ty::Int(_) |
481+
ty::Uint(_) |
482+
ty::Float(_) => {
483483
Err(CastError::NeedDeref)
484484
}
485-
ty::TyKind::Infer(t) => {
485+
ty::Infer(t) => {
486486
match t {
487487
ty::InferTy::IntVar(_) |
488488
ty::InferTy::FloatVar(_) => Err(CastError::NeedDeref),

src/librustdoc/clean/blanket_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> BlanketImplFinder <'a, 'tcx, 'rcx, 'cstore> {
8383
.expect("Cannot get impl trait");
8484

8585
match trait_ref.self_ty().sty {
86-
ty::TyParam(_) => {},
86+
ty::Param(_) => {},
8787
_ => return,
8888
}
8989

0 commit comments

Comments
 (0)