]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #3760 - rust-lang:rustup, r=flip1995
authorbors <bors@rust-lang.org>
Wed, 13 Feb 2019 21:10:06 +0000 (21:10 +0000)
committerbors <bors@rust-lang.org>
Wed, 13 Feb 2019 21:10:06 +0000 (21:10 +0000)
Rustup

cc rust-lang/rust#58137

clippy_lints/src/cyclomatic_complexity.rs
clippy_lints/src/eta_reduction.rs
clippy_lints/src/lib.rs
clippy_lints/src/loops.rs
clippy_lints/src/shadow.rs
clippy_lints/src/types.rs
clippy_lints/src/utils/inspector.rs

index c6358aed4bdb97748dcd3fb92baad0bbe134a76e..6c5c5ecbb02757bf17d2a84304814e560ca14db8 100644 (file)
@@ -78,7 +78,7 @@ fn check<'a, 'tcx: 'a>(&mut self, cx: &'a LateContext<'a, 'tcx>, body: &'tcx Bod
             returns,
             ..
         } = helper;
-        let ret_ty = cx.tables.node_id_to_type(expr.hir_id);
+        let ret_ty = cx.tables.node_type(expr.hir_id);
         let ret_adjust = if match_type(cx, ret_ty, &paths::RESULT) {
             returns
         } else {
@@ -159,7 +159,7 @@ fn visit_expr(&mut self, e: &'tcx Expr) {
             },
             ExprKind::Call(ref callee, _) => {
                 walk_expr(self, e);
-                let ty = self.cx.tables.node_id_to_type(callee.hir_id);
+                let ty = self.cx.tables.node_type(callee.hir_id);
                 match ty.sty {
                     ty::FnDef(..) | ty::FnPtr(_) => {
                         let sig = ty.fn_sig(self.cx.tcx);
index 83aca243275b2e2f39ac3f0fd58fc0f3bfe8366d..87a82b2a169e503c10db6dc0ab673ec450b05dad 100644 (file)
@@ -126,7 +126,7 @@ fn get_ufcs_type_name(
     self_arg: &Expr,
 ) -> std::option::Option<String> {
     let expected_type_of_self = &cx.tcx.fn_sig(method_def_id).inputs_and_output().skip_binder()[0].sty;
-    let actual_type_of_self = &cx.tables.node_id_to_type(self_arg.hir_id).sty;
+    let actual_type_of_self = &cx.tables.node_type(self_arg.hir_id).sty;
 
     if let Some(trait_id) = cx.tcx.trait_of_item(method_def_id) {
         //if the method expectes &self, ufcs requires explicit borrowing so closure can't be removed
index 88224763f0c469e841528d4c00d84c55706a7f80..d0032fe78fc3fbfc67604b895223c96a1c4a6fcd 100644 (file)
@@ -5,7 +5,6 @@
 #![feature(slice_patterns)]
 #![feature(stmt_expr_attributes)]
 #![feature(range_contains)]
-#![feature(str_escape)]
 #![allow(clippy::missing_docs_in_private_items)]
 #![recursion_limit = "256"]
 #![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]
index 99ed9fc86fdef312849767e9f1b200f1a14c4b2f..058d9adcb514e8ce181522083b3e2710cdba9f02 100644 (file)
@@ -1781,7 +1781,7 @@ fn check(&mut self, idx: &'tcx Expr, seqexpr: &'tcx Expr, expr: &'tcx Expr) -> b
                             if index_used_directly {
                                 self.indexed_directly.insert(
                                     seqvar.segments[0].ident.name,
-                                    (Some(extent), self.cx.tables.node_id_to_type(seqexpr.hir_id)),
+                                    (Some(extent), self.cx.tables.node_type(seqexpr.hir_id)),
                                 );
                             }
                             return false;  // no need to walk further *on the variable*
@@ -1793,7 +1793,7 @@ fn check(&mut self, idx: &'tcx Expr, seqexpr: &'tcx Expr, expr: &'tcx Expr) -> b
                             if index_used_directly {
                                 self.indexed_directly.insert(
                                     seqvar.segments[0].ident.name,
-                                    (None, self.cx.tables.node_id_to_type(seqexpr.hir_id)),
+                                    (None, self.cx.tables.node_type(seqexpr.hir_id)),
                                 );
                             }
                             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>
         if let Some(ref generic_args) = chain_method.args;
         if let Some(GenericArg::Type(ref ty)) = generic_args.args.get(0);
         then {
-            let ty = cx.tables.node_id_to_type(ty.hir_id);
+            let ty = cx.tables.node_type(ty.hir_id);
             if match_type(cx, ty, &paths::VEC) ||
                 match_type(cx, ty, &paths::VEC_DEQUE) ||
                 match_type(cx, ty, &paths::BTREEMAP) ||
index 722f64405c795f0b27e74441bd4bcc63cda2fd8a..9adac2f6d7fa3fa39b08dc39fc1d445915e18eea 100644 (file)
@@ -156,7 +156,7 @@ fn check_local<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, local: &'tcx Local, binding
 }
 
 fn is_binding(cx: &LateContext<'_, '_>, pat_id: HirId) -> bool {
-    let var_ty = cx.tables.node_id_to_type(pat_id);
+    let var_ty = cx.tables.node_type(pat_id);
     match var_ty.sty {
         ty::Adt(..) => false,
         _ => true,
index 461bd20b80c2cec88ea4e13811f71eef4e02393c..79e9f4f27d24aba4f03d4a6098d7be78a13fa2eb 100644 (file)
@@ -2343,7 +2343,7 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
             if let TyKind::Ptr(MutTy { mutbl: Mutability::MutMutable, .. }) = t.node;
             if let ExprKind::Cast(e, t) = &e.node;
             if let TyKind::Ptr(MutTy { mutbl: Mutability::MutImmutable, .. }) = t.node;
-            if let ty::Ref(..) = cx.tables.node_id_to_type(e.hir_id).sty;
+            if let ty::Ref(..) = cx.tables.node_type(e.hir_id).sty;
             then {
                 span_lint(
                     cx,
index 508bf26bab90f69641443f41699785bfd49be55b..7df1b0eb0e3e31139f08bf55a93ab24607d81529 100644 (file)
@@ -127,7 +127,7 @@ fn check_stmt(&mut self, cx: &LateContext<'a, 'tcx>, stmt: &'tcx hir::Stmt) {
         }
         match stmt.node {
             hir::StmtKind::Local(ref local) => {
-                println!("local variable of type {}", cx.tables.node_id_to_type(local.hir_id));
+                println!("local variable of type {}", cx.tables.node_type(local.hir_id));
                 println!("pattern:");
                 print_pat(cx, &local.pat, 0);
                 if let Some(ref e) = local.init {