Skip to content

Commit 0c0026e

Browse files
committed
Auto merge of rust-lang#111916 - fee1-dead-contrib:noop-method-call-warn, r=compiler-errors
make `noop_method_call` warn by default r? `@compiler-errors`
2 parents 4c9d68e + 1662fdb commit 0c0026e

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

Diff for: tests/ui/explicit_deref_methods.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![allow(
55
clippy::borrow_deref_ref,
66
suspicious_double_ref_op,
7+
noop_method_call,
78
clippy::explicit_auto_deref,
89
clippy::needless_borrow,
910
clippy::no_effect,

Diff for: tests/ui/explicit_deref_methods.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![allow(
55
clippy::borrow_deref_ref,
66
suspicious_double_ref_op,
7+
noop_method_call,
78
clippy::explicit_auto_deref,
89
clippy::needless_borrow,
910
clippy::no_effect,

Diff for: tests/ui/explicit_deref_methods.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
11
error: explicit `deref` method call
2-
--> $DIR/explicit_deref_methods.rs:54:19
2+
--> $DIR/explicit_deref_methods.rs:55:19
33
|
44
LL | let b: &str = a.deref();
55
| ^^^^^^^^^ help: try: `&*a`
66
|
77
= note: `-D clippy::explicit-deref-methods` implied by `-D warnings`
88

99
error: explicit `deref_mut` method call
10-
--> $DIR/explicit_deref_methods.rs:56:23
10+
--> $DIR/explicit_deref_methods.rs:57:23
1111
|
1212
LL | let b: &mut str = a.deref_mut();
1313
| ^^^^^^^^^^^^^ help: try: `&mut **a`
1414

1515
error: explicit `deref` method call
16-
--> $DIR/explicit_deref_methods.rs:59:39
16+
--> $DIR/explicit_deref_methods.rs:60:39
1717
|
1818
LL | let b: String = format!("{}, {}", a.deref(), a.deref());
1919
| ^^^^^^^^^ help: try: `&*a`
2020

2121
error: explicit `deref` method call
22-
--> $DIR/explicit_deref_methods.rs:59:50
22+
--> $DIR/explicit_deref_methods.rs:60:50
2323
|
2424
LL | let b: String = format!("{}, {}", a.deref(), a.deref());
2525
| ^^^^^^^^^ help: try: `&*a`
2626

2727
error: explicit `deref` method call
28-
--> $DIR/explicit_deref_methods.rs:61:20
28+
--> $DIR/explicit_deref_methods.rs:62:20
2929
|
3030
LL | println!("{}", a.deref());
3131
| ^^^^^^^^^ help: try: `&*a`
3232

3333
error: explicit `deref` method call
34-
--> $DIR/explicit_deref_methods.rs:64:11
34+
--> $DIR/explicit_deref_methods.rs:65:11
3535
|
3636
LL | match a.deref() {
3737
| ^^^^^^^^^ help: try: `&*a`
3838

3939
error: explicit `deref` method call
40-
--> $DIR/explicit_deref_methods.rs:68:28
40+
--> $DIR/explicit_deref_methods.rs:69:28
4141
|
4242
LL | let b: String = concat(a.deref());
4343
| ^^^^^^^^^ help: try: `&*a`
4444

4545
error: explicit `deref` method call
46-
--> $DIR/explicit_deref_methods.rs:70:13
46+
--> $DIR/explicit_deref_methods.rs:71:13
4747
|
4848
LL | let b = just_return(a).deref();
4949
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `just_return(a)`
5050

5151
error: explicit `deref` method call
52-
--> $DIR/explicit_deref_methods.rs:72:28
52+
--> $DIR/explicit_deref_methods.rs:73:28
5353
|
5454
LL | let b: String = concat(just_return(a).deref());
5555
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `just_return(a)`
5656

5757
error: explicit `deref` method call
58-
--> $DIR/explicit_deref_methods.rs:74:19
58+
--> $DIR/explicit_deref_methods.rs:75:19
5959
|
6060
LL | let b: &str = a.deref().deref();
6161
| ^^^^^^^^^^^^^^^^^ help: try: `&**a`
6262

6363
error: explicit `deref` method call
64-
--> $DIR/explicit_deref_methods.rs:77:13
64+
--> $DIR/explicit_deref_methods.rs:78:13
6565
|
6666
LL | let b = opt_a.unwrap().deref();
6767
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&*opt_a.unwrap()`
6868

6969
error: explicit `deref` method call
70-
--> $DIR/explicit_deref_methods.rs:114:31
70+
--> $DIR/explicit_deref_methods.rs:115:31
7171
|
7272
LL | let b: &str = expr_deref!(a.deref());
7373
| ^^^^^^^^^ help: try: `&*a`

0 commit comments

Comments
 (0)