Skip to content

Commit 3de6f9d

Browse files
author
Arnavion
committed
Use inputs/output getters for rustc::ty::FnSig instead of the now non-existent fields.
1 parent 778ce4d commit 3de6f9d

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

clippy_lints/src/cyclomatic_complexity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CCHelper<'a, 'tcx> {
142142
let ty = self.cx.tcx.tables().node_id_to_type(callee.id);
143143
match ty.sty {
144144
ty::TyFnDef(_, _, ty) |
145-
ty::TyFnPtr(ty) if ty.sig.skip_binder().output.sty == ty::TyNever => {
145+
ty::TyFnPtr(ty) if ty.sig.skip_binder().output().sty == ty::TyNever => {
146146
self.divergence += 1;
147147
}
148148
_ => (),

clippy_lints/src/eta_reduction.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn check_closure(cx: &LateContext, expr: &Expr) {
6666
ty::TyFnDef(_, _, fn_ty) |
6767
ty::TyFnPtr(fn_ty) => {
6868
if fn_ty.unsafety == Unsafety::Unsafe ||
69-
fn_ty.sig.skip_binder().output.sty == ty::TyNever {
69+
fn_ty.sig.skip_binder().output().sty == ty::TyNever {
7070
return;
7171
}
7272
}

clippy_lints/src/eval_order_dependence.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<'a, 'tcx> Visitor<'tcx> for DivergenceVisitor<'a, 'tcx> {
132132
ExprRet(_) => self.report_diverging_sub_expr(e),
133133
ExprCall(ref func, _) => match self.cx.tcx.tables().expr_ty(func).sty {
134134
ty::TyFnDef(_, _, fn_ty) |
135-
ty::TyFnPtr(fn_ty) => if let ty::TyNever = self.cx.tcx.erase_late_bound_regions(&fn_ty.sig).output.sty {
135+
ty::TyFnPtr(fn_ty) => if let ty::TyNever = self.cx.tcx.erase_late_bound_regions(&fn_ty.sig).output().sty {
136136
self.report_diverging_sub_expr(e);
137137
},
138138
_ => {},

clippy_lints/src/len_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ fn has_is_empty(cx: &LateContext, expr: &Expr) -> bool {
188188
if let ty::AssociatedKind::Method = item.kind {
189189
if &*item.name.as_str() == "is_empty" {
190190
let ty = cx.tcx.item_type(item.def_id).fn_sig().skip_binder();
191-
ty.inputs.len() == 1
191+
ty.inputs().len() == 1
192192
} else {
193193
false
194194
}

clippy_lints/src/mut_reference.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn check_arguments(cx: &LateContext, arguments: &[Expr], type_definition: &TyS,
6060
match type_definition.sty {
6161
TypeVariants::TyFnDef(_, _, fn_type) |
6262
TypeVariants::TyFnPtr(fn_type) => {
63-
let parameters = &fn_type.sig.skip_binder().inputs;
63+
let parameters = fn_type.sig.skip_binder().inputs();
6464
for (argument, parameter) in arguments.iter().zip(parameters.iter()) {
6565
match parameter.sty {
6666
TypeVariants::TyRef(_, TypeAndMut { mutbl: MutImmutable, .. }) |

clippy_lints/src/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn check_fn(cx: &LateContext, decl: &FnDecl, fn_id: NodeId) {
9494
let fn_def_id = cx.tcx.map.local_def_id(fn_id);
9595
let fn_ty = cx.tcx.item_type(fn_def_id).fn_sig().skip_binder();
9696

97-
for (arg, ty) in decl.inputs.iter().zip(&fn_ty.inputs) {
97+
for (arg, ty) in decl.inputs.iter().zip(fn_ty.inputs()) {
9898
if let ty::TyRef(_, ty::TypeAndMut { ty, mutbl: MutImmutable }) = ty.sty {
9999
if match_type(cx, ty, &paths::VEC) {
100100
span_lint(cx,

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ pub fn return_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, fn_item: NodeId) -> ty::T
751751
let fn_def_id = cx.tcx.map.local_def_id(fn_item);
752752
let fn_sig = cx.tcx.item_type(fn_def_id).fn_sig();
753753
let fn_sig = cx.tcx.liberate_late_bound_regions(parameter_env.free_id_outlive, fn_sig);
754-
fn_sig.output
754+
fn_sig.output()
755755
}
756756

757757
/// Check if two types are the same.

0 commit comments

Comments
 (0)