Skip to content

Commit 0692b2b

Browse files
committed
Temporarily disable the needless_borrow lint
1 parent d247d9c commit 0692b2b

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

clippy_lints/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
592592
mutex_atomic::MUTEX_ATOMIC,
593593
needless_bool::BOOL_COMPARISON,
594594
needless_bool::NEEDLESS_BOOL,
595-
needless_borrow::NEEDLESS_BORROW,
596595
needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
597596
needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
598597
needless_update::NEEDLESS_UPDATE,
@@ -771,7 +770,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
771770
misc_early::ZERO_PREFIXED_LITERAL,
772771
needless_bool::BOOL_COMPARISON,
773772
needless_bool::NEEDLESS_BOOL,
774-
needless_borrow::NEEDLESS_BORROW,
775773
needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
776774
needless_update::NEEDLESS_UPDATE,
777775
no_effect::NO_EFFECT,
@@ -872,6 +870,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry) {
872870
attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
873871
fallible_impl_from::FALLIBLE_IMPL_FROM,
874872
mutex_atomic::MUTEX_INTEGER,
873+
needless_borrow::NEEDLESS_BORROW,
875874
ranges::RANGE_PLUS_ONE,
876875
]);
877876
}

clippy_lints/src/needless_borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use utils::{in_macro, snippet_opt, span_lint_and_then};
2222
/// ```
2323
declare_clippy_lint! {
2424
pub NEEDLESS_BORROW,
25-
complexity,
25+
nursery,
2626
"taking a reference that is going to be automatically dereferenced"
2727
}
2828

tests/run-pass/needless_borrow_fp.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[deny(clippy)]
2+
3+
#[derive(Debug)]
4+
pub enum Error {
5+
Type(
6+
&'static str,
7+
),
8+
}
9+
10+
fn main() {}

tests/ui/eta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
#![allow(unknown_lints, unused, no_effect, redundant_closure_call, many_single_char_names, needless_pass_by_value)]
4-
#![warn(redundant_closure)]
4+
#![warn(redundant_closure, needless_borrow)]
55

66
fn main() {
77
let a = Some(1u8).map(|a| foo(a));

tests/ui/needless_borrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fn x(y: &i32) -> i32 {
55
*y
66
}
77

8-
#[warn(clippy)]
8+
#[warn(clippy, needless_borrow)]
99
#[allow(unused_variables)]
1010
fn main() {
1111
let a = 5;
@@ -42,7 +42,7 @@ trait Trait {}
4242
impl<'a> Trait for &'a str {}
4343

4444
fn h(_: &Trait) {}
45-
45+
#[warn(needless_borrow)]
4646
#[allow(dead_code)]
4747
fn issue_1432() {
4848
let mut v = Vec::<String>::new();

0 commit comments

Comments
 (0)