Skip to content

Commit b91ae16

Browse files
committed
Auto merge of rust-lang#5186 - JohnTitor:rename-fnretty, r=flip1995
Rename `FunctionRetTy` to `FnRetTy` Rustup to rust-lang#69179 changelog: none
2 parents 74f5e34 + f56e8b7 commit b91ae16

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

clippy_lints/src/functions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ fn check_must_use_candidate<'a, 'tcx>(
468468

469469
fn returns_unit(decl: &hir::FnDecl<'_>) -> bool {
470470
match decl.output {
471-
hir::FunctionRetTy::DefaultReturn(_) => true,
472-
hir::FunctionRetTy::Return(ref ty) => match ty.kind {
471+
hir::FnRetTy::DefaultReturn(_) => true,
472+
hir::FnRetTy::Return(ref ty) => match ty.kind {
473473
hir::TyKind::Tup(ref tys) => tys.is_empty(),
474474
hir::TyKind::Never => true,
475475
_ => false,

clippy_lints/src/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc::lint::in_external_macro;
44
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
55
use rustc_hir::def::{DefKind, Res};
66
use rustc_hir::intravisit::*;
7-
use rustc_hir::FunctionRetTy::Return;
7+
use rustc_hir::FnRetTy::Return;
88
use rustc_hir::*;
99
use rustc_lint::{LateContext, LateLintPass, LintContext};
1010
use rustc_session::{declare_lint_pass, declare_tool_lint};

clippy_lints/src/methods/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -3406,14 +3406,14 @@ enum OutType {
34063406
}
34073407

34083408
impl OutType {
3409-
fn matches(self, cx: &LateContext<'_, '_>, ty: &hir::FunctionRetTy<'_>) -> bool {
3409+
fn matches(self, cx: &LateContext<'_, '_>, ty: &hir::FnRetTy<'_>) -> bool {
34103410
let is_unit = |ty: &hir::Ty<'_>| SpanlessEq::new(cx).eq_ty_kind(&ty.kind, &hir::TyKind::Tup(&[]));
34113411
match (self, ty) {
3412-
(Self::Unit, &hir::FunctionRetTy::DefaultReturn(_)) => true,
3413-
(Self::Unit, &hir::FunctionRetTy::Return(ref ty)) if is_unit(ty) => true,
3414-
(Self::Bool, &hir::FunctionRetTy::Return(ref ty)) if is_bool(ty) => true,
3415-
(Self::Any, &hir::FunctionRetTy::Return(ref ty)) if !is_unit(ty) => true,
3416-
(Self::Ref, &hir::FunctionRetTy::Return(ref ty)) => matches!(ty.kind, hir::TyKind::Rptr(_, _)),
3412+
(Self::Unit, &hir::FnRetTy::DefaultReturn(_)) => true,
3413+
(Self::Unit, &hir::FnRetTy::Return(ref ty)) if is_unit(ty) => true,
3414+
(Self::Bool, &hir::FnRetTy::Return(ref ty)) if is_bool(ty) => true,
3415+
(Self::Any, &hir::FnRetTy::Return(ref ty)) if !is_unit(ty) => true,
3416+
(Self::Ref, &hir::FnRetTy::Return(ref ty)) => matches!(ty.kind, hir::TyKind::Rptr(_, _)),
34173417
_ => false,
34183418
}
34193419
}

clippy_lints/src/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ fn check_fn(cx: &LateContext<'_, '_>, decl: &FnDecl<'_>, fn_id: HirId, opt_body_
253253
}
254254
}
255255

256-
if let FunctionRetTy::Return(ref ty) = decl.output {
256+
if let FnRetTy::Return(ref ty) = decl.output {
257257
if let Some((out, Mutability::Mut, _)) = get_rptr_lm(ty) {
258258
let mut immutables = vec![];
259259
for (_, ref mutbl, ref argspan) in decl

clippy_lints/src/returns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl EarlyLintPass for Return {
242242
FnKind::Fn(.., None) => {},
243243
}
244244
if_chain! {
245-
if let ast::FunctionRetTy::Ty(ref ty) = kind.decl().output;
245+
if let ast::FnRetTy::Ty(ref ty) = kind.decl().output;
246246
if let ast::TyKind::Tup(ref vals) = ty.kind;
247247
if vals.is_empty() && !ty.span.from_expansion() && get_def(span) == get_def(ty.span);
248248
then {

clippy_lints/src/types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl Types {
242242
self.check_ty(cx, input, false);
243243
}
244244

245-
if let FunctionRetTy::Return(ref ty) = decl.output {
245+
if let FnRetTy::Return(ref ty) = decl.output {
246246
self.check_ty(cx, ty, false);
247247
}
248248
}
@@ -1476,7 +1476,7 @@ impl<'a, 'tcx> TypeComplexity {
14761476
for arg in decl.inputs {
14771477
self.check_type(cx, arg);
14781478
}
1479-
if let FunctionRetTy::Return(ref ty) = decl.output {
1479+
if let FnRetTy::Return(ref ty) = decl.output {
14801480
self.check_type(cx, ty);
14811481
}
14821482
}

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn check_trait_method_impl_decl<'a, 'tcx>(
141141
let impl_method_sig = cx.tcx.fn_sig(impl_method_def_id);
142142
let impl_method_sig = cx.tcx.erase_late_bound_regions(&impl_method_sig);
143143

144-
let output_ty = if let FunctionRetTy::Return(ty) = &impl_decl.output {
144+
let output_ty = if let FnRetTy::Return(ty) = &impl_decl.output {
145145
Some(&**ty)
146146
} else {
147147
None

clippy_lints/src/utils/hir_utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,10 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
633633
self.hash_ty(&arg);
634634
}
635635
match bfn.decl.output {
636-
FunctionRetTy::DefaultReturn(_) => {
636+
FnRetTy::DefaultReturn(_) => {
637637
().hash(&mut self.s);
638638
},
639-
FunctionRetTy::Return(ref ty) => {
639+
FnRetTy::Return(ref ty) => {
640640
self.hash_ty(ty);
641641
},
642642
}

0 commit comments

Comments
 (0)