]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #4218 - lzutao:rustup, r=phansch
authorbors <bors@rust-lang.org>
Wed, 19 Jun 2019 10:35:28 +0000 (10:35 +0000)
committerbors <bors@rust-lang.org>
Wed, 19 Jun 2019 10:35:28 +0000 (10:35 +0000)
Rustup

changelog: none

clippy_lints/src/loops.rs
clippy_lints/src/methods/mod.rs
clippy_lints/src/utils/author.rs
clippy_lints/src/utils/hir_utils.rs
clippy_lints/src/utils/inspector.rs

index c563fcae3669e22c040f725b82e30fe7e24639e8..882f9a1af1bc300e0deaceaa021205a213c878ad 100644 (file)
@@ -736,7 +736,7 @@ fn never_loop_expr(expr: &Expr, main_loop_id: HirId) -> NeverLoopResult {
             }
         },
         ExprKind::Struct(_, _, None)
-        | ExprKind::Yield(_)
+        | ExprKind::Yield(_, _)
         | ExprKind::Closure(_, _, _, _, _)
         | ExprKind::InlineAsm(_, _, _)
         | ExprKind::Path(_)
@@ -1245,7 +1245,12 @@ fn is_len_call(expr: &Expr, var: Name) -> bool {
     false
 }
 
-fn is_end_eq_array_len(cx: &LateContext<'_, '_>, end: &Expr, limits: ast::RangeLimits, indexed_ty: Ty<'_>) -> bool {
+fn is_end_eq_array_len<'tcx>(
+    cx: &LateContext<'_, 'tcx>,
+    end: &Expr,
+    limits: ast::RangeLimits,
+    indexed_ty: Ty<'tcx>,
+) -> bool {
     if_chain! {
         if let ExprKind::Lit(ref lit) = end.node;
         if let ast::LitKind::Int(end_int, _) = lit.node;
@@ -1982,7 +1987,7 @@ fn is_ref_iterable_type(cx: &LateContext<'_, '_>, e: &Expr) -> bool {
     match_type(cx, ty, &paths::BTREESET)
 }
 
-fn is_iterable_array(ty: Ty<'_>, cx: &LateContext<'_, '_>) -> bool {
+fn is_iterable_array<'tcx>(ty: Ty<'tcx>, cx: &LateContext<'_, 'tcx>) -> bool {
     // IntoIterator is currently only implemented for array sizes <= 32 in rustc
     match ty.sty {
         ty::Array(_, n) => (0..=32).contains(&n.assert_usize(cx.tcx).expect("array length")),
index d91d7ecc2b8e1d4ad03a03fcce60e9178a610dfd..29ea6d018ad5b26ba7b217fdc5daaf82554f55c6 100644 (file)
@@ -1773,7 +1773,7 @@ fn derefs_to_slice<'a, 'tcx>(
     expr: &'tcx hir::Expr,
     ty: Ty<'tcx>,
 ) -> Option<&'tcx hir::Expr> {
-    fn may_slice(cx: &LateContext<'_, '_>, ty: Ty<'_>) -> bool {
+    fn may_slice<'a>(cx: &LateContext<'_, 'a>, ty: Ty<'a>) -> bool {
         match ty.sty {
             ty::Slice(_) => true,
             ty::Adt(def, _) if def.is_box() => may_slice(cx, ty.boxed_ty()),
index d66e2b5f86400d996b220c9c311df80f30e29d90..3e3a5c48dabfc4602ee16fe111a6535057f887d7 100644 (file)
@@ -377,7 +377,7 @@ fn visit_expr(&mut self, expr: &Expr) {
                 println!("Closure(ref capture_clause, ref func, _, _, _) = {};", current);
                 println!("    // unimplemented: `ExprKind::Closure` is not further destructured at the moment");
             },
-            ExprKind::Yield(ref sub) => {
+            ExprKind::Yield(ref sub, _) => {
                 let sub_pat = self.next("sub");
                 println!("Yield(ref sub) = {};", current);
                 self.current = sub_pat;
index 7e4f46d92ecd13c83d69a28d3b2fc4783c7e3f20..7f58d21a3158b14822338e5db89e37b2a021e1f4 100644 (file)
@@ -436,7 +436,7 @@ pub fn hash_expr(&mut self, e: &Expr) {
                     self.hash_expr(&*j);
                 }
             },
-            ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
+            ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e, _) => {
                 self.hash_expr(e);
             },
             ExprKind::Call(ref fun, ref args) => {
index 633ebb3dd4234e75fec70fd4ae77b842814a8da6..f7b865bd2ca2e96c8a037798d98f430226680405 100644 (file)
@@ -227,7 +227,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
             println!("{}Closure", ind);
             println!("{}clause: {:?}", ind, clause);
         },
-        hir::ExprKind::Yield(ref sub) => {
+        hir::ExprKind::Yield(ref sub, _) => {
             println!("{}Yield", ind);
             print_expr(cx, sub, indent + 1);
         },