Skip to content

Commit 5a3cd31

Browse files
committed
1 parent db13e6f commit 5a3cd31

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

clippy_lints/src/cyclomatic_complexity.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl CyclomaticComplexity {
7878
returns,
7979
..
8080
} = helper;
81-
let ret_ty = cx.tables.node_id_to_type(expr.hir_id);
81+
let ret_ty = cx.tables.node_type(expr.hir_id);
8282
let ret_adjust = if match_type(cx, ret_ty, &paths::RESULT) {
8383
returns
8484
} else {
@@ -159,7 +159,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CCHelper<'a, 'tcx> {
159159
},
160160
ExprKind::Call(ref callee, _) => {
161161
walk_expr(self, e);
162-
let ty = self.cx.tables.node_id_to_type(callee.hir_id);
162+
let ty = self.cx.tables.node_type(callee.hir_id);
163163
match ty.sty {
164164
ty::FnDef(..) | ty::FnPtr(_) => {
165165
let sig = ty.fn_sig(self.cx.tcx);

clippy_lints/src/eta_reduction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn get_ufcs_type_name(
126126
self_arg: &Expr,
127127
) -> std::option::Option<String> {
128128
let expected_type_of_self = &cx.tcx.fn_sig(method_def_id).inputs_and_output().skip_binder()[0].sty;
129-
let actual_type_of_self = &cx.tables.node_id_to_type(self_arg.hir_id).sty;
129+
let actual_type_of_self = &cx.tables.node_type(self_arg.hir_id).sty;
130130

131131
if let Some(trait_id) = cx.tcx.trait_of_item(method_def_id) {
132132
//if the method expectes &self, ufcs requires explicit borrowing so closure can't be removed

clippy_lints/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(slice_patterns)]
66
#![feature(stmt_expr_attributes)]
77
#![feature(range_contains)]
8-
#![feature(str_escape)]
98
#![allow(clippy::missing_docs_in_private_items)]
109
#![recursion_limit = "256"]
1110
#![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]

clippy_lints/src/loops.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
17811781
if index_used_directly {
17821782
self.indexed_directly.insert(
17831783
seqvar.segments[0].ident.name,
1784-
(Some(extent), self.cx.tables.node_id_to_type(seqexpr.hir_id)),
1784+
(Some(extent), self.cx.tables.node_type(seqexpr.hir_id)),
17851785
);
17861786
}
17871787
return false; // no need to walk further *on the variable*
@@ -1793,7 +1793,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
17931793
if index_used_directly {
17941794
self.indexed_directly.insert(
17951795
seqvar.segments[0].ident.name,
1796-
(None, self.cx.tables.node_id_to_type(seqexpr.hir_id)),
1796+
(None, self.cx.tables.node_type(seqexpr.hir_id)),
17971797
);
17981798
}
17991799
return false; // no need to walk further *on the variable*
@@ -2418,7 +2418,7 @@ fn check_needless_collect<'a, 'tcx>(expr: &'tcx Expr, cx: &LateContext<'a, 'tcx>
24182418
if let Some(ref generic_args) = chain_method.args;
24192419
if let Some(GenericArg::Type(ref ty)) = generic_args.args.get(0);
24202420
then {
2421-
let ty = cx.tables.node_id_to_type(ty.hir_id);
2421+
let ty = cx.tables.node_type(ty.hir_id);
24222422
if match_type(cx, ty, &paths::VEC) ||
24232423
match_type(cx, ty, &paths::VEC_DEQUE) ||
24242424
match_type(cx, ty, &paths::BTREEMAP) ||

clippy_lints/src/shadow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn check_local<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, local: &'tcx Local, binding
156156
}
157157

158158
fn is_binding(cx: &LateContext<'_, '_>, pat_id: HirId) -> bool {
159-
let var_ty = cx.tables.node_id_to_type(pat_id);
159+
let var_ty = cx.tables.node_type(pat_id);
160160
match var_ty.sty {
161161
ty::Adt(..) => false,
162162
_ => true,

clippy_lints/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RefToMut {
23432343
if let TyKind::Ptr(MutTy { mutbl: Mutability::MutMutable, .. }) = t.node;
23442344
if let ExprKind::Cast(e, t) = &e.node;
23452345
if let TyKind::Ptr(MutTy { mutbl: Mutability::MutImmutable, .. }) = t.node;
2346-
if let ty::Ref(..) = cx.tables.node_id_to_type(e.hir_id).sty;
2346+
if let ty::Ref(..) = cx.tables.node_type(e.hir_id).sty;
23472347
then {
23482348
span_lint(
23492349
cx,

clippy_lints/src/utils/inspector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
127127
}
128128
match stmt.node {
129129
hir::StmtKind::Local(ref local) => {
130-
println!("local variable of type {}", cx.tables.node_id_to_type(local.hir_id));
130+
println!("local variable of type {}", cx.tables.node_type(local.hir_id));
131131
println!("pattern:");
132132
print_pat(cx, &local.pat, 0);
133133
if let Some(ref e) = local.init {

0 commit comments

Comments
 (0)