Skip to content

Commit 4db5c74

Browse files
committed
TyKind
1 parent 3881ce1 commit 4db5c74

18 files changed

+56
-56
lines changed

clippy_lints/src/functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<'a, 'tcx> Functions {
168168
}
169169

170170
fn raw_ptr_arg(arg: &hir::Arg, ty: &hir::Ty) -> Option<ast::NodeId> {
171-
if let (&hir::PatKind::Binding(_, id, _, _), &hir::TyPtr(_)) = (&arg.pat.node, &ty.node) {
171+
if let (&hir::PatKind::Binding(_, id, _, _), &hir::TyKind::Ptr(_)) = (&arg.pat.node, &ty.node) {
172172
Some(id)
173173
} else {
174174
None

clippy_lints/src/lifetimes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
338338

339339
fn visit_ty(&mut self, ty: &'tcx Ty) {
340340
match ty.node {
341-
TyRptr(ref lt, _) if lt.is_elided() => {
341+
TyKind::Rptr(ref lt, _) if lt.is_elided() => {
342342
self.record(&None);
343343
},
344-
TyPath(ref path) => {
344+
TyKind::Path(ref path) => {
345345
if let QPath::Resolved(_, ref path) = *path {
346346
if let Def::Existential(def_id) = path.def {
347347
let node_id = self.cx.tcx.hir.as_local_node_id(def_id).unwrap();

clippy_lints/src/methods.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@ impl SelfKind {
20562056
return true;
20572057
}
20582058
match ty.node {
2059-
hir::TyRptr(_, ref mt_ty) => {
2059+
hir::TyKind::Rptr(_, ref mt_ty) => {
20602060
let mutability_match = if self == SelfKind::Ref {
20612061
mt_ty.mutbl == hir::MutImmutable
20622062
} else {
@@ -2127,8 +2127,8 @@ fn is_as_ref_or_mut_trait(ty: &hir::Ty, self_ty: &hir::Ty, generics: &hir::Gener
21272127
fn is_ty(ty: &hir::Ty, self_ty: &hir::Ty) -> bool {
21282128
match (&ty.node, &self_ty.node) {
21292129
(
2130-
&hir::TyPath(hir::QPath::Resolved(_, ref ty_path)),
2131-
&hir::TyPath(hir::QPath::Resolved(_, ref self_ty_path)),
2130+
&hir::TyKind::Path(hir::QPath::Resolved(_, ref ty_path)),
2131+
&hir::TyKind::Path(hir::QPath::Resolved(_, ref self_ty_path)),
21322132
) => ty_path
21332133
.segments
21342134
.iter()
@@ -2139,7 +2139,7 @@ fn is_ty(ty: &hir::Ty, self_ty: &hir::Ty) -> bool {
21392139
}
21402140

21412141
fn single_segment_ty(ty: &hir::Ty) -> Option<&hir::PathSegment> {
2142-
if let hir::TyPath(ref path) = ty.node {
2142+
if let hir::TyKind::Path(ref path) = ty.node {
21432143
single_segment_path(path)
21442144
} else {
21452145
None
@@ -2176,17 +2176,17 @@ impl OutType {
21762176
fn matches(self, ty: &hir::FunctionRetTy) -> bool {
21772177
match (self, ty) {
21782178
(OutType::Unit, &hir::DefaultReturn(_)) => true,
2179-
(OutType::Unit, &hir::Return(ref ty)) if ty.node == hir::TyTup(vec![].into()) => true,
2179+
(OutType::Unit, &hir::Return(ref ty)) if ty.node == hir::TyKind::Tup(vec![].into()) => true,
21802180
(OutType::Bool, &hir::Return(ref ty)) if is_bool(ty) => true,
2181-
(OutType::Any, &hir::Return(ref ty)) if ty.node != hir::TyTup(vec![].into()) => true,
2182-
(OutType::Ref, &hir::Return(ref ty)) => matches!(ty.node, hir::TyRptr(_, _)),
2181+
(OutType::Any, &hir::Return(ref ty)) if ty.node != hir::TyKind::Tup(vec![].into()) => true,
2182+
(OutType::Ref, &hir::Return(ref ty)) => matches!(ty.node, hir::TyKind::Rptr(_, _)),
21832183
_ => false,
21842184
}
21852185
}
21862186
}
21872187

21882188
fn is_bool(ty: &hir::Ty) -> bool {
2189-
if let hir::TyPath(ref p) = ty.node {
2189+
if let hir::TyKind::Path(ref p) = ty.node {
21902190
match_qpath(p, &["bool"])
21912191
} else {
21922192
false

clippy_lints/src/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ fn non_macro_local(cx: &LateContext, def: &def::Def) -> bool {
571571

572572
fn check_cast(cx: &LateContext, span: Span, e: &Expr, ty: &Ty) {
573573
if_chain! {
574-
if let TyPtr(MutTy { mutbl, .. }) = ty.node;
574+
if let TyKind::Ptr(MutTy { mutbl, .. }) = ty.node;
575575
if let ExprKind::Lit(ref lit) = e.node;
576576
if let LitKind::Int(value, ..) = lit.node;
577577
if value == 0;

clippy_lints/src/mut_mut.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ impl<'a, 'tcx> intravisit::Visitor<'tcx> for MutVisitor<'a, 'tcx> {
8787
}
8888

8989
fn visit_ty(&mut self, ty: &'tcx hir::Ty) {
90-
if let hir::TyRptr(
90+
if let hir::TyKind::Rptr(
9191
_,
9292
hir::MutTy {
9393
ty: ref pty,
9494
mutbl: hir::MutMutable,
9595
},
9696
) = ty.node
9797
{
98-
if let hir::TyRptr(
98+
if let hir::TyKind::Rptr(
9999
_,
100100
hir::MutTy {
101101
mutbl: hir::MutMutable,

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
215215
if match_type(cx, ty, &paths::VEC);
216216
if let Some(clone_spans) =
217217
get_spans(cx, Some(body.id()), idx, &[("clone", ".to_owned()")]);
218-
if let TyPath(QPath::Resolved(_, ref path)) = input.node;
218+
if let TyKind::Path(QPath::Resolved(_, ref path)) = input.node;
219219
if let Some(elem_ty) = path.segments.iter()
220220
.find(|seg| seg.ident.name == "Vec")
221221
.and_then(|ps| ps.args.as_ref())

clippy_lints/src/ptr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn check_fn(cx: &LateContext, decl: &FnDecl, fn_id: NodeId, opt_body_id: Option<
159159
if match_type(cx, ty, &paths::VEC) {
160160
let mut ty_snippet = None;
161161
if_chain! {
162-
if let TyPath(QPath::Resolved(_, ref path)) = walk_ptrs_hir_ty(arg).node;
162+
if let TyKind::Path(QPath::Resolved(_, ref path)) = walk_ptrs_hir_ty(arg).node;
163163
if let Some(&PathSegment{args: Some(ref parameters), ..}) = path.segments.last();
164164
then {
165165
let types: Vec<_> = parameters.args.iter().filter_map(|arg| match arg {
@@ -219,8 +219,8 @@ fn check_fn(cx: &LateContext, decl: &FnDecl, fn_id: NodeId, opt_body_id: Option<
219219
}
220220
} else if match_type(cx, ty, &paths::COW) {
221221
if_chain! {
222-
if let TyRptr(_, MutTy { ref ty, ..} ) = arg.node;
223-
if let TyPath(ref path) = ty.node;
222+
if let TyKind::Rptr(_, MutTy { ref ty, ..} ) = arg.node;
223+
if let TyKind::Path(ref path) = ty.node;
224224
if let QPath::Resolved(None, ref pp) = *path;
225225
if let [ref bx] = *pp.segments;
226226
if let Some(ref params) = bx.args;
@@ -273,7 +273,7 @@ fn check_fn(cx: &LateContext, decl: &FnDecl, fn_id: NodeId, opt_body_id: Option<
273273
}
274274

275275
fn get_rptr_lm(ty: &Ty) -> Option<(&Lifetime, Mutability, Span)> {
276-
if let Ty_::TyRptr(ref lt, ref m) = ty.node {
276+
if let TyKind::Rptr(ref lt, ref m) = ty.node {
277277
Some((lt, m.mutbl, ty.span))
278278
} else {
279279
None

clippy_lints/src/shadow.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,16 +347,16 @@ fn check_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, bindings:
347347

348348
fn check_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: &'tcx Ty, bindings: &mut Vec<(Name, Span)>) {
349349
match ty.node {
350-
TySlice(ref sty) => check_ty(cx, sty, bindings),
351-
TyArray(ref fty, ref anon_const) => {
350+
TyKind::Slice(ref sty) => check_ty(cx, sty, bindings),
351+
TyKind::Array(ref fty, ref anon_const) => {
352352
check_ty(cx, fty, bindings);
353353
check_expr(cx, &cx.tcx.hir.body(anon_const.body).value, bindings);
354354
},
355-
TyPtr(MutTy { ty: ref mty, .. }) | TyRptr(_, MutTy { ty: ref mty, .. }) => check_ty(cx, mty, bindings),
356-
TyTup(ref tup) => for t in tup {
355+
TyKind::Ptr(MutTy { ty: ref mty, .. }) | TyKind::Rptr(_, MutTy { ty: ref mty, .. }) => check_ty(cx, mty, bindings),
356+
TyKind::Tup(ref tup) => for t in tup {
357357
check_ty(cx, t, bindings)
358358
},
359-
TyTypeof(ref anon_const) => check_expr(cx, &cx.tcx.hir.body(anon_const.body).value, bindings),
359+
TyKind::Typeof(ref anon_const) => check_expr(cx, &cx.tcx.hir.body(anon_const.body).value, bindings),
360360
_ => (),
361361
}
362362
}

clippy_lints/src/swap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn check_manual_swap(cx: &LateContext, block: &Block) {
9090
if SpanlessEq::new(cx).ignore_fn().eq_expr(lhs1, lhs2) {
9191
let ty = walk_ptrs_ty(cx.tables.expr_ty(lhs1));
9292

93-
if matches!(ty.sty, ty::TySlice(_)) ||
93+
if matches!(ty.sty, ty::TyKind::Slice(_)) ||
9494
matches!(ty.sty, ty::TyArray(_, _)) ||
9595
match_type(cx, ty, &paths::VEC) ||
9696
match_type(cx, ty, &paths::VEC_DEQUE) {

clippy_lints/src/transmute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ fn get_type_snippet(cx: &LateContext, path: &QPath, to_ref_ty: Ty) -> String {
461461
GenericArg::Type(ty) => Some(ty),
462462
GenericArg::Lifetime(_) => None,
463463
}).nth(1);
464-
if let TyRptr(_, ref to_ty) = to_ty.node;
464+
if let TyKind::Rptr(_, ref to_ty) = to_ty.node;
465465
then {
466466
return snippet(cx, to_ty.ty.span, &to_ref_ty.to_string()).to_string();
467467
}

clippy_lints/src/trivially_copy_pass_by_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TriviallyCopyPassByRef {
123123
if is_copy(cx, ty);
124124
if let Some(size) = cx.layout_of(ty).ok().map(|l| l.size.bytes());
125125
if size <= self.limit;
126-
if let Ty_::TyRptr(_, MutTy { ty: ref decl_ty, .. }) = input.node;
126+
if let TyKind::Rptr(_, MutTy { ty: ref decl_ty, .. }) = input.node;
127127
then {
128128
let value_type = if is_self(arg) {
129129
"self".into()

clippy_lints/src/types.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn match_type_parameter(cx: &LateContext, qpath: &QPath, path: &[&str]) -> bool
186186
GenericArg::Type(ty) => Some(ty),
187187
GenericArg::Lifetime(_) => None,
188188
});
189-
if let TyPath(ref qpath) = ty.node;
189+
if let TyKind::Path(ref qpath) = ty.node;
190190
if let Some(did) = opt_def_id(cx.tables.qpath_def(qpath, cx.tcx.hir.node_to_hir_id(ty.id)));
191191
if match_def_path(cx.tcx, did, path);
192192
then {
@@ -206,7 +206,7 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool) {
206206
return;
207207
}
208208
match ast_ty.node {
209-
TyPath(ref qpath) if !is_local => {
209+
TyKind::Path(ref qpath) if !is_local => {
210210
let hir_id = cx.tcx.hir.node_to_hir_id(ast_ty.id);
211211
let def = cx.tables.qpath_def(qpath, hir_id);
212212
if let Some(def_id) = opt_def_id(def) {
@@ -282,10 +282,10 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool) {
282282
},
283283
}
284284
},
285-
TyRptr(ref lt, ref mut_ty) => check_ty_rptr(cx, ast_ty, is_local, lt, mut_ty),
285+
TyKind::Rptr(ref lt, ref mut_ty) => check_ty_rptr(cx, ast_ty, is_local, lt, mut_ty),
286286
// recurse
287-
TySlice(ref ty) | TyArray(ref ty, _) | TyPtr(MutTy { ref ty, .. }) => check_ty(cx, ty, is_local),
288-
TyTup(ref tys) => for ty in tys {
287+
TyKind::Slice(ref ty) | TyKind::Array(ref ty, _) | TyKind::Ptr(MutTy { ref ty, .. }) => check_ty(cx, ty, is_local),
288+
TyKind::Tup(ref tys) => for ty in tys {
289289
check_ty(cx, ty, is_local);
290290
},
291291
_ => {},
@@ -294,7 +294,7 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool) {
294294

295295
fn check_ty_rptr(cx: &LateContext, ast_ty: &hir::Ty, is_local: bool, lt: &Lifetime, mut_ty: &MutTy) {
296296
match mut_ty.ty.node {
297-
TyPath(ref qpath) => {
297+
TyKind::Path(ref qpath) => {
298298
let hir_id = cx.tcx.hir.node_to_hir_id(mut_ty.ty.id);
299299
let def = cx.tables.qpath_def(qpath, hir_id);
300300
if_chain! {
@@ -1214,13 +1214,13 @@ impl<'tcx> Visitor<'tcx> for TypeComplexityVisitor {
12141214
fn visit_ty(&mut self, ty: &'tcx hir::Ty) {
12151215
let (add_score, sub_nest) = match ty.node {
12161216
// _, &x and *x have only small overhead; don't mess with nesting level
1217-
TyInfer | TyPtr(..) | TyRptr(..) => (1, 0),
1217+
TyKind::Infer | TyKind::Ptr(..) | TyKind::Rptr(..) => (1, 0),
12181218

12191219
// the "normal" components of a type: named types, arrays/tuples
1220-
TyPath(..) | TySlice(..) | TyTup(..) | TyArray(..) => (10 * self.nest, 1),
1220+
TyKind::Path(..) | TyKind::Slice(..) | TyKind::Tup(..) | TyKind::Array(..) => (10 * self.nest, 1),
12211221

12221222
// function types bring a lot of overhead
1223-
TyBareFn(..) => (50 * self.nest, 1),
1223+
TyKind::BareFn(..) => (50 * self.nest, 1),
12241224

12251225
TyTraitObject(ref param_bounds, _) => {
12261226
let has_lifetime_parameters = param_bounds
@@ -1878,7 +1878,7 @@ enum ImplicitHasherType<'tcx> {
18781878
impl<'tcx> ImplicitHasherType<'tcx> {
18791879
/// Checks that `ty` is a target type without a BuildHasher.
18801880
fn new<'a>(cx: &LateContext<'a, 'tcx>, hir_ty: &hir::Ty) -> Option<Self> {
1881-
if let TyPath(QPath::Resolved(None, ref path)) = hir_ty.node {
1881+
if let TyKind::Path(QPath::Resolved(None, ref path)) = hir_ty.node {
18821882
let params: Vec<_> = path.segments.last().as_ref()?.args.as_ref()?
18831883
.args.iter().filter_map(|arg| match arg {
18841884
GenericArg::Type(ty) => Some(ty),
@@ -1986,7 +1986,7 @@ impl<'a, 'b, 'tcx: 'a + 'b> Visitor<'tcx> for ImplicitHasherConstructorVisitor<'
19861986
if_chain! {
19871987
if let ExprKind::Call(ref fun, ref args) = e.node;
19881988
if let ExprKind::Path(QPath::TypeRelative(ref ty, ref method)) = fun.node;
1989-
if let TyPath(QPath::Resolved(None, ref ty_path)) = ty.node;
1989+
if let TyKind::Path(QPath::Resolved(None, ref ty_path)) = ty.node;
19901990
then {
19911991
if !same_tys(self.cx, self.target.ty(), self.body.expr_ty(e)) {
19921992
return;

clippy_lints/src/use_self.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UseSelf {
5656
}
5757
if_chain! {
5858
if let ItemImpl(.., ref item_type, ref refs) = item.node;
59-
if let Ty_::TyPath(QPath::Resolved(_, ref item_path)) = item_type.node;
59+
if let TyKind::Path(QPath::Resolved(_, ref item_path)) = item_type.node;
6060
then {
6161
let parameters = &item_path.segments.last().expect(SEGMENTS_MSG).args;
6262
let should_check = if let Some(ref params) = *parameters {

clippy_lints/src/utils/author.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
283283
let qp_label = self.next("qp");
284284

285285
println!("Cast(ref {}, ref {}) = {};", cast_pat, cast_ty, current);
286-
if let Ty_::TyPath(ref qp) = ty.node {
287-
println!(" if let Ty_::TyPath(ref {}) = {}.node;", qp_label, cast_ty);
286+
if let TyKind::Path(ref qp) = ty.node {
287+
println!(" if let TyKind::Path(ref {}) = {}.node;", qp_label, cast_ty);
288288
self.current = qp_label;
289289
self.print_qpath(qp);
290290
}
@@ -674,7 +674,7 @@ fn print_path(path: &QPath, first: &mut bool) {
674674
print!("{:?}", segment.ident.as_str());
675675
},
676676
QPath::TypeRelative(ref ty, ref segment) => match ty.node {
677-
hir::Ty_::TyPath(ref inner_path) => {
677+
hir::TyKind::Path(ref inner_path) => {
678678
print_path(inner_path, first);
679679
if *first {
680680
*first = false;

clippy_lints/src/utils/hir_utils.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
240240

241241
fn eq_ty(&mut self, left: &Ty, right: &Ty) -> bool {
242242
match (&left.node, &right.node) {
243-
(&TySlice(ref l_vec), &TySlice(ref r_vec)) => self.eq_ty(l_vec, r_vec),
244-
(&TyArray(ref lt, ref ll_id), &TyArray(ref rt, ref rl_id)) => {
243+
(&TyKind::Slice(ref l_vec), &TyKind::Slice(ref r_vec)) => self.eq_ty(l_vec, r_vec),
244+
(&TyKind::Array(ref lt, ref ll_id), &TyKind::Array(ref rt, ref rl_id)) => {
245245
let full_table = self.tables;
246246

247247
let mut celcx = constant_context(self.cx, self.cx.tcx.body_tables(ll_id.body));
@@ -256,13 +256,13 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
256256
self.tables = full_table;
257257
eq_ty && ll == rl
258258
},
259-
(&TyPtr(ref l_mut), &TyPtr(ref r_mut)) => l_mut.mutbl == r_mut.mutbl && self.eq_ty(&*l_mut.ty, &*r_mut.ty),
260-
(&TyRptr(_, ref l_rmut), &TyRptr(_, ref r_rmut)) => {
259+
(&TyKind::Ptr(ref l_mut), &TyKind::Ptr(ref r_mut)) => l_mut.mutbl == r_mut.mutbl && self.eq_ty(&*l_mut.ty, &*r_mut.ty),
260+
(&TyKind::Rptr(_, ref l_rmut), &TyKind::Rptr(_, ref r_rmut)) => {
261261
l_rmut.mutbl == r_rmut.mutbl && self.eq_ty(&*l_rmut.ty, &*r_rmut.ty)
262262
},
263-
(&TyPath(ref l), &TyPath(ref r)) => self.eq_qpath(l, r),
264-
(&TyTup(ref l), &TyTup(ref r)) => over(l, r, |l, r| self.eq_ty(l, r)),
265-
(&TyInfer, &TyInfer) => true,
263+
(&TyKind::Path(ref l), &TyKind::Path(ref r)) => self.eq_qpath(l, r),
264+
(&TyKind::Tup(ref l), &TyKind::Tup(ref r)) => over(l, r, |l, r| self.eq_ty(l, r)),
265+
(&TyKind::Infer, &TyKind::Infer) => true,
266266
_ => false,
267267
}
268268
}

clippy_lints/src/utils/internal_lints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LintWithoutLintPass {
160160

161161

162162
fn is_lint_ref_type(ty: &Ty) -> bool {
163-
if let TyRptr(
163+
if let TyKind::Rptr(
164164
_,
165165
MutTy {
166166
ty: ref inner,
167167
mutbl: MutImmutable,
168168
},
169169
) = ty.node
170170
{
171-
if let TyPath(ref path) = inner.node {
171+
if let TyKind::Path(ref path) = inner.node {
172172
return match_qpath(path, &paths::LINT);
173173
}
174174
}
@@ -177,7 +177,7 @@ fn is_lint_ref_type(ty: &Ty) -> bool {
177177

178178

179179
fn is_lint_array_type(ty: &Ty) -> bool {
180-
if let TyPath(ref path) = ty.node {
180+
if let TyKind::Path(ref path) = ty.node {
181181
match_qpath(path, &paths::LINT_ARRAY)
182182
} else {
183183
false

clippy_lints/src/utils/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn match_qpath(path: &QPath, segments: &[&str]) -> bool {
210210
match *path {
211211
QPath::Resolved(_, ref path) => match_path(path, segments),
212212
QPath::TypeRelative(ref ty, ref segment) => match ty.node {
213-
TyPath(ref inner_path) => {
213+
TyKind::Path(ref inner_path) => {
214214
!segments.is_empty() && match_qpath(inner_path, &segments[..(segments.len() - 1)])
215215
&& segment.ident.name == segments[segments.len() - 1]
216216
},
@@ -667,7 +667,7 @@ where
667667
/// Return the base type for HIR references and pointers.
668668
pub fn walk_ptrs_hir_ty(ty: &hir::Ty) -> &hir::Ty {
669669
match ty.node {
670-
TyPtr(ref mut_ty) | TyRptr(_, ref mut_ty) => walk_ptrs_hir_ty(&mut_ty.ty),
670+
TyKind::Ptr(ref mut_ty) | TyKind::Rptr(_, ref mut_ty) => walk_ptrs_hir_ty(&mut_ty.ty),
671671
_ => ty,
672672
}
673673
}
@@ -998,7 +998,7 @@ pub fn is_self(slf: &Arg) -> bool {
998998

999999
pub fn is_self_ty(slf: &hir::Ty) -> bool {
10001000
if_chain! {
1001-
if let TyPath(ref qp) = slf.node;
1001+
if let TyKind::Path(ref qp) = slf.node;
10021002
if let QPath::Resolved(None, ref path) = *qp;
10031003
if let Def::SelfTy(..) = path.def;
10041004
then {

tests/ui/author.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ if_chain! {
33
if let Decl_::DeclLocal(ref local) = decl.node;
44
if let Some(ref init) = local.init
55
if let ExprKind::Cast(ref expr, ref cast_ty) = init.node;
6-
if let Ty_::TyPath(ref qp) = cast_ty.node;
6+
if let TyKind::Path(ref qp) = cast_ty.node;
77
if match_qpath(qp, &["char"]);
88
if let ExprKind::Lit(ref lit) = expr.node;
99
if let LitKind::Int(69, _) = lit.node;

0 commit comments

Comments
 (0)