Skip to content

Commit ca84f08

Browse files
committed
rm bounds and generic_args_we_can_change for now
it seems like they're no longer needed with the new approach?
1 parent fbbd92a commit ca84f08

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

clippy_lints/src/needless_path_new.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,6 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPathNew<'tcx> {
100100

101101
let parameters = sig.inputs();
102102

103-
let _bounds = tcx.param_env(def_id).caller_bounds();
104-
// dbg!(bounds);
105-
106-
let generic_args_we_can_change: Vec<_> = generic_args
107-
.iter()
108-
.filter_map(|g| g.as_type())
109-
// if a generic is used in multiple places, we should better not touch it,
110-
// since we'd need to suggest changing both parameters that using it at once,
111-
// which might not be possible
112-
.filter(|g| sig.inputs_and_output.into_iter().filter(|i| i.contains(*g)).count() < 2)
113-
// don't want to mess with the output type, since that probably has some additional
114-
// restrictions imposed from the outside, which we don't want to bother checking
115-
.filter(|g| !sig.output().contains(*g))
116-
.collect();
117-
dbg!(&generic_args_we_can_change);
118-
119-
if generic_args_we_can_change.is_empty() {
120-
// can't change anything
121-
return;
122-
}
123-
124103
for (argument, parameter) in iter::zip(arguments, parameters) {
125104
// we want `argument` to be `Path::new(x)`, which has one arg, x
126105
if let ExprKind::Call(func, [arg]) = argument.kind

0 commit comments

Comments
 (0)