Skip to content

Commit 3550676

Browse files
committed
bail out on non-empty Binder
1 parent e4782f7 commit 3550676

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

clippy_lints/src/needless_path_new.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,11 @@ fn check_arguments<'tcx>(
8585

8686
let implements_asref_path = |arg| implements_trait(cx, arg, asref_def_id, &[path_ty.into()]);
8787

88-
if let ty::FnDef(def_id, ..) = type_definition.kind() {
89-
let parameters = dbg!(type_definition.fn_sig(tcx)).skip_binder().inputs();
88+
if let ty::FnDef(def_id, ..) = type_definition.kind()
89+
// if there are any bound vars, just give up... we might be able to be smarter here
90+
&& let Some(fn_sig) = type_definition.fn_sig(tcx).no_bound_vars()
91+
{
92+
let parameters = fn_sig.inputs();
9093

9194
let bounds = tcx.param_env(def_id).caller_bounds();
9295
dbg!(bounds);

0 commit comments

Comments
 (0)