Skip to content

Commit

Permalink
Remove unnecessary TyKind::s
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Aug 22, 2018
1 parent 8a5dccd commit 08f3685
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/librustc/middle/dead.rs
Expand Up @@ -236,7 +236,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
self.handle_field_access(&lhs, expr.id);
}
hir::ExprKind::Struct(_, ref fields, _) => {
if let ty::TyKind::Adt(ref adt, _) = self.tables.expr_ty(expr).sty {
if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).sty {
self.mark_as_used_if_union(adt, fields);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/traits/error_reporting.rs
Expand Up @@ -802,7 +802,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
let expected = match expected_trait_ref.skip_binder().substs.type_at(1).sty {
ty::Tuple(ref tys) => tys.iter()
.map(|t| match t.sty {
ty::TyKind::Tuple(ref tys) => ArgKind::Tuple(
ty::Tuple(ref tys) => ArgKind::Tuple(
Some(span),
tys.iter()
.map(|ty| ("_".to_owned(), ty.sty.to_string()))
Expand Down Expand Up @@ -899,7 +899,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
let mut trait_type = trait_ref.self_ty();

for refs_remaining in 0..refs_number {
if let ty::TyKind::Ref(_, t_type, _) = trait_type.sty {
if let ty::Ref(_, t_type, _) = trait_type.sty {
trait_type = t_type;

let substs = self.tcx.mk_substs_trait(trait_type, &[]);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/util.rs
Expand Up @@ -503,7 +503,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
!impl_generics.region_param(ebr, self).pure_wrt_drop
}
UnpackedKind::Type(&ty::TyS {
sty: ty::TyKind::Param(ref pt), ..
sty: ty::Param(ref pt), ..
}) => {
!impl_generics.type_param(pt, self).pure_wrt_drop
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/mod.rs
Expand Up @@ -697,7 +697,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
Some(nl.to_string()),
Origin::Ast);
let need_note = match lp.ty.sty {
ty::TyKind::Closure(id, _) => {
ty::Closure(id, _) => {
let node_id = self.tcx.hir.as_local_node_id(id).unwrap();
let hir_id = self.tcx.hir.node_to_hir_id(node_id);
if let Some((span, name)) = self.tables.closure_kind_origins().get(hir_id) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/borrow_check/error_reporting.rs
Expand Up @@ -134,7 +134,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {

if let Some(ty) = self.retrieve_type_for_place(place) {
let needs_note = match ty.sty {
ty::TyKind::Closure(id, _) => {
ty::Closure(id, _) => {
let tables = self.tcx.typeck_tables_of(id);
let node_id = self.tcx.hir.as_local_node_id(id).unwrap();
let hir_id = self.tcx.hir.node_to_hir_id(node_id);
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/_match.rs
Expand Up @@ -53,7 +53,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
PatKind::Lit(ref lt) => {
let ty = self.check_expr(lt);
match ty.sty {
ty::TyKind::Ref(..) => false,
ty::Ref(..) => false,
_ => true,
}
}
Expand Down Expand Up @@ -84,7 +84,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
expected = loop {
debug!("inspecting {:?} with type {:?}", exp_ty, exp_ty.sty);
match exp_ty.sty {
ty::TyKind::Ref(_, inner_ty, inner_mutability) => {
ty::Ref(_, inner_ty, inner_mutability) => {
debug!("current discriminant is Ref, inserting implicit deref");
// Preserve the reference type. We'll need it later during HAIR lowering.
pat_adjustments.push(exp_ty);
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_typeck/check/cast.rs
Expand Up @@ -477,12 +477,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
(RPtr(p), Int(_)) |
(RPtr(p), Float) => {
match p.ty.sty {
ty::TyKind::Int(_) |
ty::TyKind::Uint(_) |
ty::TyKind::Float(_) => {
ty::Int(_) |
ty::Uint(_) |
ty::Float(_) => {
Err(CastError::NeedDeref)
}
ty::TyKind::Infer(t) => {
ty::Infer(t) => {
match t {
ty::InferTy::IntVar(_) |
ty::InferTy::FloatVar(_) => Err(CastError::NeedDeref),
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/blanket_impl.rs
Expand Up @@ -83,7 +83,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> BlanketImplFinder <'a, 'tcx, 'rcx, 'cstore> {
.expect("Cannot get impl trait");

match trait_ref.self_ty().sty {
ty::TyParam(_) => {},
ty::Param(_) => {},
_ => return,
}

Expand Down

0 comments on commit 08f3685

Please sign in to comment.