Skip to content

Commit e43fedd

Browse files
committed
Merge branch 'master' of https://github.com/sjwang05/rust-clippy
2 parents cdf65c8 + 251a475 commit e43fedd

16 files changed

+1140
-1070
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5172,6 +5172,7 @@ Released 2018-09-13
51725172
[`needless_bool_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign
51735173
[`needless_borrow`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
51745174
[`needless_borrowed_reference`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
5175+
[`needless_borrows_for_generic_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
51755176
[`needless_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect
51765177
[`needless_continue`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue
51775178
[`needless_doctest_main`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
481481
crate::needless_bool::NEEDLESS_BOOL_INFO,
482482
crate::needless_bool::NEEDLESS_BOOL_ASSIGN_INFO,
483483
crate::needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE_INFO,
484+
crate::needless_borrows_for_generic_args::NEEDLESS_BORROWS_FOR_GENERIC_ARGS_INFO,
484485
crate::needless_continue::NEEDLESS_CONTINUE_INFO,
485486
crate::needless_else::NEEDLESS_ELSE_INFO,
486487
crate::needless_for_each::NEEDLESS_FOR_EACH_INFO,

clippy_lints/src/dereference.rs

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

clippy_lints/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ mod mutex_atomic;
229229
mod needless_arbitrary_self_type;
230230
mod needless_bool;
231231
mod needless_borrowed_ref;
232+
mod needless_borrows_for_generic_args;
232233
mod needless_continue;
233234
mod needless_else;
234235
mod needless_for_each;
@@ -888,7 +889,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
888889
store.register_late_pass(move |_| Box::new(wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports)));
889890
store.register_late_pass(|_| Box::<redundant_pub_crate::RedundantPubCrate>::default());
890891
store.register_late_pass(|_| Box::new(unnamed_address::UnnamedAddress));
891-
store.register_late_pass(move |_| Box::new(dereference::Dereferencing::new(msrv())));
892+
store.register_late_pass(|_| Box::<dereference::Dereferencing<'_>>::default());
892893
store.register_late_pass(|_| Box::new(option_if_let_else::OptionIfLetElse));
893894
store.register_late_pass(|_| Box::new(future_not_send::FutureNotSend));
894895
let future_size_threshold = conf.future_size_threshold;
@@ -1113,6 +1114,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11131114
store.register_late_pass(|_| Box::new(missing_asserts_for_indexing::MissingAssertsForIndexing));
11141115
store.register_late_pass(|_| Box::new(unnecessary_map_on_constructor::UnnecessaryMapOnConstructor));
11151116
store.register_late_pass(|_| Box::new(ambiguous_method_calls::AmbiguousMethodCalls));
1117+
store.register_late_pass(move |_| {
1118+
Box::new(needless_borrows_for_generic_args::NeedlessBorrowsForGenericArgs::new(
1119+
msrv(),
1120+
))
1121+
});
11161122
// add lints here, do not remove this comment, it's used in `new_lint`
11171123
}
11181124

0 commit comments

Comments
 (0)