Remove unnecessary TyKind::s

This commit is contained in:
varkor 2018-08-22 02:08:01 +01:00
parent 8a5dccde2a
commit 08f3685a82
8 changed files with 13 additions and 13 deletions

View File

@ -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);
}
}

View File

@ -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()))
@ -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, &[]);

View File

@ -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
}

View File

@ -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) {

View File

@ -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);

View File

@ -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,
}
}
@ -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);

View File

@ -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),

View File

@ -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,
}