Skip to content

Commit afb586f

Browse files
committed
change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add EarlyBinder to fn_sig in metadata
1 parent 38899d0 commit afb586f

28 files changed

+48
-48
lines changed

clippy_lints/src/casts/as_ptr_cast_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
1717
&& let ExprKind::MethodCall(method_name, receiver, [], _) = cast_expr.peel_blocks().kind
1818
&& method_name.ident.name == rustc_span::sym::as_ptr
1919
&& let Some(as_ptr_did) = cx.typeck_results().type_dependent_def_id(cast_expr.peel_blocks().hir_id)
20-
&& let as_ptr_sig = cx.tcx.bound_fn_sig(as_ptr_did).subst_identity()
20+
&& let as_ptr_sig = cx.tcx.fn_sig(as_ptr_did).subst_identity()
2121
&& let Some(first_param_ty) = as_ptr_sig.skip_binder().inputs().iter().next()
2222
&& let ty::Ref(_, _, Mutability::Not) = first_param_ty.kind()
2323
&& let Some(recv) = snippet_opt(cx, receiver.span)

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
141141

142142
ExprKind::MethodCall(_, receiver, args, _) => {
143143
if let Some(def_id) = self.cx.typeck_results().type_dependent_def_id(expr.hir_id) {
144-
let fn_sig = self.cx.tcx.bound_fn_sig(def_id).subst_identity().skip_binder();
144+
let fn_sig = self.cx.tcx.fn_sig(def_id).subst_identity().skip_binder();
145145
for (expr, bound) in iter::zip(std::iter::once(*receiver).chain(args.iter()), fn_sig.inputs()) {
146146
self.ty_bounds.push((*bound).into());
147147
self.visit_expr(expr);
@@ -215,7 +215,7 @@ fn fn_sig_opt<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<PolyFnSig<'
215215
let node_ty = cx.typeck_results().node_type_opt(hir_id)?;
216216
// We can't use `Ty::fn_sig` because it automatically performs substs, this may result in FNs.
217217
match node_ty.kind() {
218-
ty::FnDef(def_id, _) => Some(cx.tcx.bound_fn_sig(*def_id).subst_identity()),
218+
ty::FnDef(def_id, _) => Some(cx.tcx.fn_sig(*def_id).subst_identity()),
219219
ty::FnPtr(fn_sig) => Some(*fn_sig),
220220
_ => None,
221221
}

clippy_lints/src/dereference.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ fn walk_parents<'tcx>(
759759
}) if span.ctxt() == ctxt => {
760760
let output = cx
761761
.tcx
762-
.erase_late_bound_regions(cx.tcx.bound_fn_sig(owner_id.to_def_id()).subst_identity().output());
762+
.erase_late_bound_regions(cx.tcx.fn_sig(owner_id).subst_identity().output());
763763
Some(ty_auto_deref_stability(cx, output, precedence).position_for_result(cx))
764764
},
765765

@@ -791,7 +791,7 @@ fn walk_parents<'tcx>(
791791
} else {
792792
let output = cx
793793
.tcx
794-
.erase_late_bound_regions(cx.tcx.bound_fn_sig(cx.tcx.hir().local_def_id(owner_id).into()).subst_identity().output());
794+
.erase_late_bound_regions(cx.tcx.fn_sig(cx.tcx.hir().local_def_id(owner_id)).subst_identity().output());
795795
ty_auto_deref_stability(cx, output, precedence).position_for_result(cx)
796796
},
797797
)
@@ -858,7 +858,7 @@ fn walk_parents<'tcx>(
858858
&& let subs = cx
859859
.typeck_results()
860860
.node_substs_opt(parent.hir_id).map(|subs| &subs[1..]).unwrap_or_default()
861-
&& let impl_ty = if cx.tcx.bound_fn_sig(id).subst_identity().skip_binder().inputs()[0].is_ref() {
861+
&& let impl_ty = if cx.tcx.fn_sig(id).subst_identity().skip_binder().inputs()[0].is_ref() {
862862
// Trait methods taking `&self`
863863
sub_ty
864864
} else {
@@ -879,7 +879,7 @@ fn walk_parents<'tcx>(
879879
return Some(Position::MethodReceiver);
880880
}
881881
args.iter().position(|arg| arg.hir_id == child_id).map(|i| {
882-
let ty = cx.tcx.bound_fn_sig(id).subst_identity().skip_binder().inputs()[i + 1];
882+
let ty = cx.tcx.fn_sig(id).subst_identity().skip_binder().inputs()[i + 1];
883883
// `e.hir_id == child_id` for https://github.com/rust-lang/rust-clippy/issues/9739
884884
// `method.args.is_none()` for https://github.com/rust-lang/rust-clippy/issues/9782
885885
if e.hir_id == child_id && method.args.is_none() && let ty::Param(param_ty) = ty.kind() {
@@ -896,7 +896,7 @@ fn walk_parents<'tcx>(
896896
} else {
897897
ty_auto_deref_stability(
898898
cx,
899-
cx.tcx.erase_late_bound_regions(cx.tcx.bound_fn_sig(id).subst_identity().input(i + 1)),
899+
cx.tcx.erase_late_bound_regions(cx.tcx.fn_sig(id).subst_identity().input(i + 1)),
900900
precedence,
901901
)
902902
.position_for_arg()
@@ -1093,7 +1093,7 @@ fn needless_borrow_impl_arg_position<'tcx>(
10931093
let sized_trait_def_id = cx.tcx.lang_items().sized_trait();
10941094

10951095
let Some(callee_def_id) = fn_def_id(cx, parent) else { return Position::Other(precedence) };
1096-
let fn_sig = cx.tcx.bound_fn_sig(callee_def_id).subst_identity().skip_binder();
1096+
let fn_sig = cx.tcx.fn_sig(callee_def_id).subst_identity().skip_binder();
10971097
let substs_with_expr_ty = cx
10981098
.typeck_results()
10991099
.node_substs(if let ExprKind::Call(callee, _) = parent.kind {
@@ -1221,7 +1221,7 @@ fn has_ref_mut_self_method(cx: &LateContext<'_>, trait_def_id: DefId) -> bool {
12211221
.in_definition_order()
12221222
.any(|assoc_item| {
12231223
if assoc_item.fn_has_self_parameter {
1224-
let self_ty = cx.tcx.bound_fn_sig(assoc_item.def_id).subst_identity().skip_binder().inputs()[0];
1224+
let self_ty = cx.tcx.fn_sig(assoc_item.def_id).subst_identity().skip_binder().inputs()[0];
12251225
matches!(self_ty.kind(), ty::Ref(_, _, Mutability::Mut))
12261226
} else {
12271227
false

clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn check_raw_ptr<'tcx>(
5858
},
5959
hir::ExprKind::MethodCall(_, recv, args, _) => {
6060
let def_id = typeck.type_dependent_def_id(e.hir_id).unwrap();
61-
if cx.tcx.bound_fn_sig(def_id).skip_binder().skip_binder().unsafety == hir::Unsafety::Unsafe {
61+
if cx.tcx.fn_sig(def_id).skip_binder().skip_binder().unsafety == hir::Unsafety::Unsafe {
6262
check_arg(cx, &raw_ptrs, recv);
6363
for arg in args {
6464
check_arg(cx, &raw_ptrs, arg);

clippy_lints/src/functions/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn result_err_ty<'tcx>(
2121
) -> Option<(&'tcx hir::Ty<'tcx>, Ty<'tcx>)> {
2222
if !in_external_macro(cx.sess(), item_span)
2323
&& let hir::FnRetTy::Return(hir_ty) = decl.output
24-
&& let ty = cx.tcx.erase_late_bound_regions(cx.tcx.bound_fn_sig(id.into()).subst_identity().output())
24+
&& let ty = cx.tcx.erase_late_bound_regions(cx.tcx.fn_sig(id).subst_identity().output())
2525
&& is_type_diagnostic_item(cx, ty, sym::Result)
2626
&& let ty::Adt(_, substs) = ty.kind()
2727
{

clippy_lints/src/inherent_to_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
124124
.expect("Failed to get trait ID of `Display`!");
125125

126126
// Get the real type of 'self'
127-
let self_type = cx.tcx.bound_fn_sig(item.owner_id.to_def_id()).skip_binder().input(0);
127+
let self_type = cx.tcx.fn_sig(item.owner_id).skip_binder().input(0);
128128
let self_type = self_type.skip_binder().peel_refs();
129129

130130
// Emit either a warning or an error

clippy_lints/src/iter_not_returning_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'tcx> LateLintPass<'tcx> for IterNotReturningIterator {
6666

6767
fn check_sig(cx: &LateContext<'_>, name: &str, sig: &FnSig<'_>, fn_id: LocalDefId) {
6868
if sig.decl.implicit_self.has_implicit_self() {
69-
let ret_ty = cx.tcx.erase_late_bound_regions(cx.tcx.bound_fn_sig(fn_id.into()).subst_identity().output());
69+
let ret_ty = cx.tcx.erase_late_bound_regions(cx.tcx.fn_sig(fn_id).subst_identity().output());
7070
let ret_ty = cx
7171
.tcx
7272
.try_normalize_erasing_regions(cx.param_env, ret_ty)

clippy_lints/src/len_zero.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'tcx> LateLintPass<'tcx> for LenZero {
144144
if let Some(local_id) = ty_id.as_local();
145145
let ty_hir_id = cx.tcx.hir().local_def_id_to_hir_id(local_id);
146146
if !is_lint_allowed(cx, LEN_WITHOUT_IS_EMPTY, ty_hir_id);
147-
if let Some(output) = parse_len_output(cx, cx.tcx.bound_fn_sig(item.owner_id.to_def_id()).subst_identity().skip_binder());
147+
if let Some(output) = parse_len_output(cx, cx.tcx.fn_sig(item.owner_id).subst_identity().skip_binder());
148148
then {
149149
let (name, kind) = match cx.tcx.hir().find(ty_hir_id) {
150150
Some(Node::ForeignItem(x)) => (x.ident.name, "extern type"),
@@ -196,7 +196,7 @@ fn check_trait_items(cx: &LateContext<'_>, visited_trait: &Item<'_>, trait_items
196196
fn is_named_self(cx: &LateContext<'_>, item: &TraitItemRef, name: Symbol) -> bool {
197197
item.ident.name == name
198198
&& if let AssocItemKind::Fn { has_self } = item.kind {
199-
has_self && { cx.tcx.bound_fn_sig(item.id.owner_id.to_def_id()).skip_binder().inputs().skip_binder().len() == 1 }
199+
has_self && { cx.tcx.fn_sig(item.id.owner_id).skip_binder().inputs().skip_binder().len() == 1 }
200200
} else {
201201
false
202202
}
@@ -224,7 +224,7 @@ fn check_trait_items(cx: &LateContext<'_>, visited_trait: &Item<'_>, trait_items
224224
.any(|i| {
225225
i.kind == ty::AssocKind::Fn
226226
&& i.fn_has_self_parameter
227-
&& cx.tcx.bound_fn_sig(i.def_id).skip_binder().inputs().skip_binder().len() == 1
227+
&& cx.tcx.fn_sig(i.def_id).skip_binder().inputs().skip_binder().len() == 1
228228
});
229229

230230
if !is_empty_method_found {
@@ -342,7 +342,7 @@ fn check_for_is_empty<'tcx>(
342342
),
343343
Some(is_empty)
344344
if !(is_empty.fn_has_self_parameter
345-
&& check_is_empty_sig(cx.tcx.bound_fn_sig(is_empty.def_id).subst_identity().skip_binder(), self_kind, output)) =>
345+
&& check_is_empty_sig(cx.tcx.fn_sig(is_empty.def_id).subst_identity().skip_binder(), self_kind, output)) =>
346346
{
347347
(
348348
format!(
@@ -473,7 +473,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
473473
/// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
474474
fn is_is_empty(cx: &LateContext<'_>, item: &ty::AssocItem) -> bool {
475475
if item.kind == ty::AssocKind::Fn {
476-
let sig = cx.tcx.bound_fn_sig(item.def_id).skip_binder();
476+
let sig = cx.tcx.fn_sig(item.def_id).skip_binder();
477477
let ty = sig.skip_binder();
478478
ty.inputs().len() == 1
479479
} else {

clippy_lints/src/loops/needless_range_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
370370
ExprKind::MethodCall(_, receiver, args, _) => {
371371
let def_id = self.cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();
372372
for (ty, expr) in iter::zip(
373-
self.cx.tcx.bound_fn_sig(def_id).subst_identity().inputs().skip_binder(),
373+
self.cx.tcx.fn_sig(def_id).subst_identity().inputs().skip_binder(),
374374
std::iter::once(receiver).chain(args.iter()),
375375
) {
376376
self.prefer_mutable = false;

clippy_lints/src/map_unit_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn is_unit_function(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool {
104104
let ty = cx.typeck_results().expr_ty(expr);
105105

106106
if let ty::FnDef(id, _) = *ty.kind() {
107-
if let Some(fn_type) = cx.tcx.bound_fn_sig(id).subst_identity().no_bound_vars() {
107+
if let Some(fn_type) = cx.tcx.fn_sig(id).subst_identity().no_bound_vars() {
108108
return is_unit_type(fn_type.output());
109109
}
110110
}

clippy_lints/src/methods/expect_fun_call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub(super) fn check<'tcx>(
7070
if let hir::ExprKind::Path(ref p) = fun.kind {
7171
match cx.qpath_res(p, fun.hir_id) {
7272
hir::def::Res::Def(hir::def::DefKind::Fn | hir::def::DefKind::AssocFn, def_id) => matches!(
73-
cx.tcx.bound_fn_sig(def_id).subst_identity().output().skip_binder().kind(),
73+
cx.tcx.fn_sig(def_id).subst_identity().output().skip_binder().kind(),
7474
ty::Ref(re, ..) if re.is_static(),
7575
),
7676
_ => false,
@@ -84,7 +84,7 @@ pub(super) fn check<'tcx>(
8484
.type_dependent_def_id(arg.hir_id)
8585
.map_or(false, |method_id| {
8686
matches!(
87-
cx.tcx.bound_fn_sig(method_id).subst_identity().output().skip_binder().kind(),
87+
cx.tcx.fn_sig(method_id).subst_identity().output().skip_binder().kind(),
8888
ty::Ref(re, ..) if re.is_static()
8989
)
9090
})

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
33523352

33533353
let implements_trait = matches!(item.kind, hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. }));
33543354
if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind {
3355-
let method_sig = cx.tcx.bound_fn_sig(impl_item.owner_id.to_def_id()).subst_identity();
3355+
let method_sig = cx.tcx.fn_sig(impl_item.owner_id).subst_identity();
33563356
let method_sig = cx.tcx.erase_late_bound_regions(method_sig);
33573357
let first_arg_ty_opt = method_sig.inputs().iter().next().copied();
33583358
// if this impl block implements a trait, lint in trait definition instead

clippy_lints/src/methods/needless_collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub(super) fn check<'tcx>(
137137
/// Checks if the given method call matches the expected signature of `([&[mut]] self) -> bool`
138138
fn is_is_empty_sig(cx: &LateContext<'_>, call_id: HirId) -> bool {
139139
cx.typeck_results().type_dependent_def_id(call_id).map_or(false, |id| {
140-
let sig = cx.tcx.bound_fn_sig(id).subst_identity().skip_binder();
140+
let sig = cx.tcx.fn_sig(id).subst_identity().skip_binder();
141141
sig.inputs().len() == 1 && sig.output().is_bool()
142142
})
143143
}
@@ -165,7 +165,7 @@ fn iterates_same_ty<'tcx>(cx: &LateContext<'tcx>, iter_ty: Ty<'tcx>, collect_ty:
165165
fn is_contains_sig(cx: &LateContext<'_>, call_id: HirId, iter_expr: &Expr<'_>) -> bool {
166166
let typeck = cx.typeck_results();
167167
if let Some(id) = typeck.type_dependent_def_id(call_id)
168-
&& let sig = cx.tcx.bound_fn_sig(id).subst_identity()
168+
&& let sig = cx.tcx.fn_sig(id).subst_identity()
169169
&& sig.skip_binder().output().is_bool()
170170
&& let [_, search_ty] = *sig.skip_binder().inputs()
171171
&& let ty::Ref(_, search_ty, Mutability::Not) = *cx.tcx.erase_late_bound_regions(sig.rebind(search_ty)).kind()

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn check_other_call_arg<'tcx>(
246246
if_chain! {
247247
if let Some((maybe_call, maybe_arg)) = skip_addr_of_ancestors(cx, expr);
248248
if let Some((callee_def_id, _, recv, call_args)) = get_callee_substs_and_args(cx, maybe_call);
249-
let fn_sig = cx.tcx.bound_fn_sig(callee_def_id).subst_identity().skip_binder();
249+
let fn_sig = cx.tcx.fn_sig(callee_def_id).subst_identity().skip_binder();
250250
if let Some(i) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == maybe_arg.hir_id);
251251
if let Some(input) = fn_sig.inputs().get(i);
252252
let (input, n_refs) = peel_mid_ty_refs(*input);
@@ -386,7 +386,7 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
386386
Node::Expr(parent_expr) => {
387387
if let Some((callee_def_id, call_substs, recv, call_args)) = get_callee_substs_and_args(cx, parent_expr)
388388
{
389-
let fn_sig = cx.tcx.bound_fn_sig(callee_def_id).subst_identity().skip_binder();
389+
let fn_sig = cx.tcx.fn_sig(callee_def_id).subst_identity().skip_binder();
390390
if let Some(arg_index) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == expr.hir_id)
391391
&& let Some(param_ty) = fn_sig.inputs().get(arg_index)
392392
&& let ty::Param(ParamTy { index: param_index , ..}) = param_ty.kind()

clippy_lints/src/mut_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl MutableKeyType {
138138

139139
fn check_sig(&self, cx: &LateContext<'_>, item_hir_id: hir::HirId, decl: &hir::FnDecl<'_>) {
140140
let fn_def_id = cx.tcx.hir().local_def_id(item_hir_id);
141-
let fn_sig = cx.tcx.bound_fn_sig(fn_def_id.into()).subst_identity();
141+
let fn_sig = cx.tcx.fn_sig(fn_def_id).subst_identity();
142142
for (hir_ty, ty) in iter::zip(decl.inputs, fn_sig.inputs().skip_binder()) {
143143
self.check_ty_(cx, hir_ty.span, *ty);
144144
}

clippy_lints/src/needless_pass_by_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
147147
ctx
148148
};
149149

150-
let fn_sig = cx.tcx.bound_fn_sig(fn_def_id.into()).subst_identity();
150+
let fn_sig = cx.tcx.fn_sig(fn_def_id).subst_identity();
151151
let fn_sig = cx.tcx.erase_late_bound_regions(fn_sig);
152152

153153
for (idx, ((input, &ty), arg)) in decl.inputs.iter().zip(fn_sig.inputs()).zip(body.params).enumerate() {

clippy_lints/src/pass_by_ref_or_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl<'tcx> PassByRefOrValue {
143143
return;
144144
}
145145

146-
let fn_sig = cx.tcx.bound_fn_sig(def_id.into()).subst_identity();
146+
let fn_sig = cx.tcx.fn_sig(def_id).subst_identity();
147147
let fn_body = cx.enclosing_body.map(|id| cx.tcx.hir().body(id));
148148

149149
// Gather all the lifetimes found in the output type which may affect whether

clippy_lints/src/ptr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<'tcx> LateLintPass<'tcx> for Ptr {
164164
check_mut_from_ref(cx, sig, None);
165165
for arg in check_fn_args(
166166
cx,
167-
cx.tcx.bound_fn_sig(item.owner_id.to_def_id()).subst_identity().skip_binder().inputs(),
167+
cx.tcx.fn_sig(item.owner_id).subst_identity().skip_binder().inputs(),
168168
sig.decl.inputs,
169169
&[],
170170
)
@@ -217,7 +217,7 @@ impl<'tcx> LateLintPass<'tcx> for Ptr {
217217

218218
check_mut_from_ref(cx, sig, Some(body));
219219
let decl = sig.decl;
220-
let sig = cx.tcx.bound_fn_sig(item_id.to_def_id()).subst_identity().skip_binder();
220+
let sig = cx.tcx.fn_sig(item_id).subst_identity().skip_binder();
221221
let lint_args: Vec<_> = check_fn_args(cx, sig.inputs(), decl.inputs, body.params)
222222
.filter(|arg| !is_trait_item || arg.mutability() == Mutability::Not)
223223
.collect();
@@ -624,7 +624,7 @@ fn check_ptr_arg_usage<'tcx>(cx: &LateContext<'tcx>, body: &'tcx Body<'_>, args:
624624
return;
625625
};
626626

627-
match *self.cx.tcx.bound_fn_sig(id).subst_identity().skip_binder().inputs()[i].peel_refs().kind() {
627+
match *self.cx.tcx.fn_sig(id).subst_identity().skip_binder().inputs()[i].peel_refs().kind() {
628628
ty::Dynamic(preds, _, _) if !matches_preds(self.cx, args.deref_ty.ty(self.cx), preds) => {
629629
set_skip_flag();
630630
},

clippy_lints/src/returns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ fn last_statement_borrows<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>)
287287
if let Some(def_id) = fn_def_id(cx, e)
288288
&& cx
289289
.tcx
290-
.bound_fn_sig(def_id)
290+
.fn_sig(def_id)
291291
.subst_identity()
292292
.skip_binder()
293293
.output()

clippy_lints/src/unit_return_expecting_ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn get_projection_pred<'tcx>(
7676
fn get_args_to_check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Vec<(usize, String)> {
7777
let mut args_to_check = Vec::new();
7878
if let Some(def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) {
79-
let fn_sig = cx.tcx.bound_fn_sig(def_id).subst_identity();
79+
let fn_sig = cx.tcx.fn_sig(def_id).subst_identity();
8080
let generics = cx.tcx.predicates_of(def_id);
8181
let fn_mut_preds = get_trait_predicates_for_trait_id(cx, generics, cx.tcx.lang_items().fn_mut_trait());
8282
let ord_preds = get_trait_predicates_for_trait_id(cx, generics, cx.tcx.get_diagnostic_item(sym::Ord));

0 commit comments

Comments
 (0)