Skip to content

Commit b15a517

Browse files
committed
Split part of needless_borrow into needless_generic_arg_borrows
1 parent 2766cd9 commit b15a517

15 files changed

+1102
-1061
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5176,6 +5176,7 @@ Released 2018-09-13
51765176
[`needless_doctest_main`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
51775177
[`needless_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_else
51785178
[`needless_for_each`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_for_each
5179+
[`needless_generic_arg_borrows`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_generic_arg_borrows
51795180
[`needless_if`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_if
51805181
[`needless_late_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
51815182
[`needless_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
482482
crate::needless_continue::NEEDLESS_CONTINUE_INFO,
483483
crate::needless_else::NEEDLESS_ELSE_INFO,
484484
crate::needless_for_each::NEEDLESS_FOR_EACH_INFO,
485+
crate::needless_generic_arg_borrows::NEEDLESS_GENERIC_ARG_BORROWS_INFO,
485486
crate::needless_if::NEEDLESS_IF_INFO,
486487
crate::needless_late_init::NEEDLESS_LATE_INIT_INFO,
487488
crate::needless_parens_on_range_literals::NEEDLESS_PARENS_ON_RANGE_LITERALS_INFO,

clippy_lints/src/dereference.rs

Lines changed: 5 additions & 366 deletions
Large diffs are not rendered by default.

clippy_lints/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ mod needless_borrowed_ref;
231231
mod needless_continue;
232232
mod needless_else;
233233
mod needless_for_each;
234+
mod needless_generic_arg_borrows;
234235
mod needless_if;
235236
mod needless_late_init;
236237
mod needless_parens_on_range_literals;
@@ -880,7 +881,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
880881
store.register_late_pass(move |_| Box::new(wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports)));
881882
store.register_late_pass(|_| Box::<redundant_pub_crate::RedundantPubCrate>::default());
882883
store.register_late_pass(|_| Box::new(unnamed_address::UnnamedAddress));
883-
store.register_late_pass(move |_| Box::new(dereference::Dereferencing::new(msrv())));
884+
store.register_late_pass(|_| Box::<dereference::Dereferencing<'_>>::default());
884885
store.register_late_pass(|_| Box::new(option_if_let_else::OptionIfLetElse));
885886
store.register_late_pass(|_| Box::new(future_not_send::FutureNotSend));
886887
let future_size_threshold = conf.future_size_threshold;
@@ -1104,6 +1105,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11041105
store.register_late_pass(|_| Box::new(implied_bounds_in_impls::ImpliedBoundsInImpls));
11051106
store.register_late_pass(|_| Box::new(missing_asserts_for_indexing::MissingAssertsForIndexing));
11061107
store.register_late_pass(|_| Box::new(unnecessary_map_on_constructor::UnnecessaryMapOnConstructor));
1108+
store.register_late_pass(move |_| Box::new(needless_generic_arg_borrows::NeedlessGenericArgBorrows::new(msrv())));
11071109
// add lints here, do not remove this comment, it's used in `new_lint`
11081110
}
11091111

0 commit comments

Comments
 (0)