about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-06 20:53:17 +0000
committerbors <bors@rust-lang.org>2020-02-06 20:53:17 +0000
commitee842df61df91f3ed3e33a23f8393c47d384ef40 (patch)
treed96b440cb143b8904b66c92ed94310ea874d9837
parenta6f310ed0e22a422e7001efbe7e4bf2a0c9a0eff (diff)
parent9897927504ca64b90e2e7a742a22d7ddb6a3bc69 (diff)
downloadrust-ee842df61df91f3ed3e33a23f8393c47d384ef40.tar.gz
rust-ee842df61df91f3ed3e33a23f8393c47d384ef40.zip
Auto merge of #5143 - flip1995:rustup, r=flip1995
Rustup to rust-lang/rust#68788

cc rust-lang/rust#68901

changelog: none
-rw-r--r--clippy_lints/src/misc_early.rs4
-rw-r--r--clippy_lints/src/non_expressive_names.rs2
-rw-r--r--clippy_lints/src/returns.rs9
-rw-r--r--clippy_lints/src/utils/internal_lints.rs8
-rw-r--r--tests/ui/custom_ice_message.stderr2
5 files changed, 12 insertions, 13 deletions
diff --git a/clippy_lints/src/misc_early.rs b/clippy_lints/src/misc_early.rs
index 6f54750cb9b..e0e2a0caee4 100644
--- a/clippy_lints/src/misc_early.rs
+++ b/clippy_lints/src/misc_early.rs
@@ -372,10 +372,10 @@ impl EarlyLintPass for MiscEarlyLints {
         check_unneeded_wildcard_pattern(cx, pat);
     }
 
-    fn check_fn(&mut self, cx: &EarlyContext<'_>, _: FnKind<'_>, decl: &FnDecl, _: Span, _: NodeId) {
+    fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: Span, _: NodeId) {
         let mut registered_names: FxHashMap<String, Span> = FxHashMap::default();
 
-        for arg in &decl.inputs {
+        for arg in &fn_kind.decl().inputs {
             if let PatKind::Ident(_, ident, None) = arg.pat.kind {
                 let arg_name = ident.to_string();
 
diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs
index b9df82d65e3..2a7fbe6c0c6 100644
--- a/clippy_lints/src/non_expressive_names.rs
+++ b/clippy_lints/src/non_expressive_names.rs
@@ -352,7 +352,7 @@ impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
 
 impl EarlyLintPass for NonExpressiveNames {
     fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
-        if let ItemKind::Fn(ref sig, _, ref blk) = item.kind {
+        if let ItemKind::Fn(ref sig, _, Some(ref blk)) = item.kind {
             do_check(self, cx, &item.attrs, &sig.decl, blk);
         }
     }
diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs
index c903df0f211..6bf373a9a62 100644
--- a/clippy_lints/src/returns.rs
+++ b/clippy_lints/src/returns.rs
@@ -235,13 +235,14 @@ impl Return {
 }
 
 impl EarlyLintPass for Return {
-    fn check_fn(&mut self, cx: &EarlyContext<'_>, kind: FnKind<'_>, decl: &ast::FnDecl, span: Span, _: ast::NodeId) {
+    fn check_fn(&mut self, cx: &EarlyContext<'_>, kind: FnKind<'_>, span: Span, _: ast::NodeId) {
         match kind {
-            FnKind::ItemFn(.., block) | FnKind::Method(.., block) => self.check_block_return(cx, block),
-            FnKind::Closure(body) => self.check_final_expr(cx, body, Some(body.span), RetReplacement::Empty),
+            FnKind::Fn(.., Some(block)) => self.check_block_return(cx, block),
+            FnKind::Closure(_, body) => self.check_final_expr(cx, body, Some(body.span), RetReplacement::Empty),
+            FnKind::Fn(.., None) => {},
         }
         if_chain! {
-            if let ast::FunctionRetTy::Ty(ref ty) = decl.output;
+            if let ast::FunctionRetTy::Ty(ref ty) = kind.decl().output;
             if let ast::TyKind::Tup(ref vals) = ty.kind;
             if vals.is_empty() && !ty.span.from_expansion() && get_def(span) == get_def(ty.span);
             then {
diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs
index af07cf66658..945999de89f 100644
--- a/clippy_lints/src/utils/internal_lints.rs
+++ b/clippy_lints/src/utils/internal_lints.rs
@@ -380,18 +380,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnDataPass {
 declare_lint_pass!(ProduceIce => [PRODUCE_ICE]);
 
 impl EarlyLintPass for ProduceIce {
-    fn check_fn(&mut self, _: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: &ast::FnDecl, _: Span, _: ast::NodeId) {
+    fn check_fn(&mut self, _: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: Span, _: ast::NodeId) {
         if is_trigger_fn(fn_kind) {
-            panic!("Testing the ICE message");
+            panic!("Would you like some help with that?");
         }
     }
 }
 
 fn is_trigger_fn(fn_kind: FnKind<'_>) -> bool {
     match fn_kind {
-        FnKind::ItemFn(ident, ..) | FnKind::Method(ident, ..) => {
-            ident.name.as_str() == "it_looks_like_you_are_trying_to_kill_clippy"
-        },
+        FnKind::Fn(_, ident, ..) => ident.name.as_str() == "it_looks_like_you_are_trying_to_kill_clippy",
         FnKind::Closure(..) => false,
     }
 }
diff --git a/tests/ui/custom_ice_message.stderr b/tests/ui/custom_ice_message.stderr
index 36f243ebc5f..a9a65a38c10 100644
--- a/tests/ui/custom_ice_message.stderr
+++ b/tests/ui/custom_ice_message.stderr
@@ -1,4 +1,4 @@
-thread 'rustc' panicked at 'Testing the ICE message', clippy_lints/src/utils/internal_lints.rs
+thread 'rustc' panicked at 'Would you like some help with that?', clippy_lints/src/utils/internal_lints.rs
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 
 error: internal compiler error: unexpected panic