about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-17 13:01:21 +0000
committerbors <bors@rust-lang.org>2020-02-17 13:01:21 +0000
commitb91ae16eb1ab03b996de5ffc44db054244c1d2f6 (patch)
tree9ddd6c0977ca4f08eca97dfb271b533c757d1e5a
parent74f5e348fa9cf1bd3c701eed9d664948275509dd (diff)
parentf56e8b7eb47402056b851b11203acfa0994bc8e0 (diff)
downloadrust-b91ae16eb1ab03b996de5ffc44db054244c1d2f6.tar.gz
rust-b91ae16eb1ab03b996de5ffc44db054244c1d2f6.zip
Auto merge of #5186 - JohnTitor:rename-fnretty, r=flip1995
Rename `FunctionRetTy` to `FnRetTy`

Rustup to rust-lang/rust#69179

changelog: none
-rw-r--r--clippy_lints/src/functions.rs4
-rw-r--r--clippy_lints/src/lifetimes.rs2
-rw-r--r--clippy_lints/src/methods/mod.rs12
-rw-r--r--clippy_lints/src/ptr.rs2
-rw-r--r--clippy_lints/src/returns.rs2
-rw-r--r--clippy_lints/src/types.rs4
-rw-r--r--clippy_lints/src/use_self.rs2
-rw-r--r--clippy_lints/src/utils/hir_utils.rs4
8 files changed, 16 insertions, 16 deletions
diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs
index ee9221c811e..ce0bfea5160 100644
--- a/clippy_lints/src/functions.rs
+++ b/clippy_lints/src/functions.rs
@@ -468,8 +468,8 @@ fn check_must_use_candidate<'a, 'tcx>(
 
 fn returns_unit(decl: &hir::FnDecl<'_>) -> bool {
     match decl.output {
-        hir::FunctionRetTy::DefaultReturn(_) => true,
-        hir::FunctionRetTy::Return(ref ty) => match ty.kind {
+        hir::FnRetTy::DefaultReturn(_) => true,
+        hir::FnRetTy::Return(ref ty) => match ty.kind {
             hir::TyKind::Tup(ref tys) => tys.is_empty(),
             hir::TyKind::Never => true,
             _ => false,
diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs
index 13484ba0fa7..f98021bca45 100644
--- a/clippy_lints/src/lifetimes.rs
+++ b/clippy_lints/src/lifetimes.rs
@@ -4,7 +4,7 @@ use rustc::lint::in_external_macro;
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::intravisit::*;
-use rustc_hir::FunctionRetTy::Return;
+use rustc_hir::FnRetTy::Return;
 use rustc_hir::*;
 use rustc_lint::{LateContext, LateLintPass, LintContext};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index d8494865477..00a9fd89464 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -3406,14 +3406,14 @@ enum OutType {
 }
 
 impl OutType {
-    fn matches(self, cx: &LateContext<'_, '_>, ty: &hir::FunctionRetTy<'_>) -> bool {
+    fn matches(self, cx: &LateContext<'_, '_>, ty: &hir::FnRetTy<'_>) -> bool {
         let is_unit = |ty: &hir::Ty<'_>| SpanlessEq::new(cx).eq_ty_kind(&ty.kind, &hir::TyKind::Tup(&[]));
         match (self, ty) {
-            (Self::Unit, &hir::FunctionRetTy::DefaultReturn(_)) => true,
-            (Self::Unit, &hir::FunctionRetTy::Return(ref ty)) if is_unit(ty) => true,
-            (Self::Bool, &hir::FunctionRetTy::Return(ref ty)) if is_bool(ty) => true,
-            (Self::Any, &hir::FunctionRetTy::Return(ref ty)) if !is_unit(ty) => true,
-            (Self::Ref, &hir::FunctionRetTy::Return(ref ty)) => matches!(ty.kind, hir::TyKind::Rptr(_, _)),
+            (Self::Unit, &hir::FnRetTy::DefaultReturn(_)) => true,
+            (Self::Unit, &hir::FnRetTy::Return(ref ty)) if is_unit(ty) => true,
+            (Self::Bool, &hir::FnRetTy::Return(ref ty)) if is_bool(ty) => true,
+            (Self::Any, &hir::FnRetTy::Return(ref ty)) if !is_unit(ty) => true,
+            (Self::Ref, &hir::FnRetTy::Return(ref ty)) => matches!(ty.kind, hir::TyKind::Rptr(_, _)),
             _ => false,
         }
     }
diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs
index 445f065aace..33cfa5d75c6 100644
--- a/clippy_lints/src/ptr.rs
+++ b/clippy_lints/src/ptr.rs
@@ -253,7 +253,7 @@ fn check_fn(cx: &LateContext<'_, '_>, decl: &FnDecl<'_>, fn_id: HirId, opt_body_
         }
     }
 
-    if let FunctionRetTy::Return(ref ty) = decl.output {
+    if let FnRetTy::Return(ref ty) = decl.output {
         if let Some((out, Mutability::Mut, _)) = get_rptr_lm(ty) {
             let mut immutables = vec![];
             for (_, ref mutbl, ref argspan) in decl
diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs
index 6bf373a9a62..fc371dccd73 100644
--- a/clippy_lints/src/returns.rs
+++ b/clippy_lints/src/returns.rs
@@ -242,7 +242,7 @@ impl EarlyLintPass for Return {
             FnKind::Fn(.., None) => {},
         }
         if_chain! {
-            if let ast::FunctionRetTy::Ty(ref ty) = kind.decl().output;
+            if let ast::FnRetTy::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/types.rs b/clippy_lints/src/types.rs
index e47f2480a54..d23487b5b33 100644
--- a/clippy_lints/src/types.rs
+++ b/clippy_lints/src/types.rs
@@ -242,7 +242,7 @@ impl Types {
             self.check_ty(cx, input, false);
         }
 
-        if let FunctionRetTy::Return(ref ty) = decl.output {
+        if let FnRetTy::Return(ref ty) = decl.output {
             self.check_ty(cx, ty, false);
         }
     }
@@ -1476,7 +1476,7 @@ impl<'a, 'tcx> TypeComplexity {
         for arg in decl.inputs {
             self.check_type(cx, arg);
         }
-        if let FunctionRetTy::Return(ref ty) = decl.output {
+        if let FnRetTy::Return(ref ty) = decl.output {
             self.check_type(cx, ty);
         }
     }
diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs
index 9be070bd3d1..da961a5f89d 100644
--- a/clippy_lints/src/use_self.rs
+++ b/clippy_lints/src/use_self.rs
@@ -141,7 +141,7 @@ fn check_trait_method_impl_decl<'a, 'tcx>(
     let impl_method_sig = cx.tcx.fn_sig(impl_method_def_id);
     let impl_method_sig = cx.tcx.erase_late_bound_regions(&impl_method_sig);
 
-    let output_ty = if let FunctionRetTy::Return(ty) = &impl_decl.output {
+    let output_ty = if let FnRetTy::Return(ty) = &impl_decl.output {
         Some(&**ty)
     } else {
         None
diff --git a/clippy_lints/src/utils/hir_utils.rs b/clippy_lints/src/utils/hir_utils.rs
index c209ebaaf13..f5f35afa9ba 100644
--- a/clippy_lints/src/utils/hir_utils.rs
+++ b/clippy_lints/src/utils/hir_utils.rs
@@ -633,10 +633,10 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
                     self.hash_ty(&arg);
                 }
                 match bfn.decl.output {
-                    FunctionRetTy::DefaultReturn(_) => {
+                    FnRetTy::DefaultReturn(_) => {
                         ().hash(&mut self.s);
                     },
-                    FunctionRetTy::Return(ref ty) => {
+                    FnRetTy::Return(ref ty) => {
                         self.hash_ty(ty);
                     },
                 }