blob: 5036884366cfc680e705df0fbf228e08f0dd4500 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:55:19
|
LL | let b: &str = a.deref();
| ^^^^^^^^^ help: try: `&*a`
|
= note: `-D clippy::explicit-deref-methods` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::explicit_deref_methods)]`
error: explicit `deref_mut` method call
--> tests/ui/explicit_deref_methods.rs:58:23
|
LL | let b: &mut str = a.deref_mut();
| ^^^^^^^^^^^^^ help: try: `&mut **a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:62:39
|
LL | let b: String = format!("{}, {}", a.deref(), a.deref());
| ^^^^^^^^^ help: try: `&*a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:62:50
|
LL | let b: String = format!("{}, {}", a.deref(), a.deref());
| ^^^^^^^^^ help: try: `&*a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:66:20
|
LL | println!("{}", a.deref());
| ^^^^^^^^^ help: try: `&*a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:70:11
|
LL | match a.deref() {
| ^^^^^^^^^ help: try: `&*a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:75:28
|
LL | let b: String = concat(a.deref());
| ^^^^^^^^^ help: try: `&*a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:78:13
|
LL | let b = just_return(a).deref();
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `just_return(a)`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:81:28
|
LL | let b: String = concat(just_return(a).deref());
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `just_return(a)`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:121:31
|
LL | let b: &str = expr_deref!(a.deref());
| ^^^^^^^^^ help: try: `&*a`
error: explicit `deref` method call
--> tests/ui/explicit_deref_methods.rs:139:14
|
LL | let _ = &Deref::deref(&"foo");
| ^^^^^^^^^^^^^^^^^^^^ help: try: `*&"foo"`
error: explicit `deref_mut` method call
--> tests/ui/explicit_deref_methods.rs:141:14
|
LL | let _ = &DerefMut::deref_mut(&mut x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut **&mut x`
error: explicit `deref_mut` method call
--> tests/ui/explicit_deref_methods.rs:142:14
|
LL | let _ = &DerefMut::deref_mut((&mut &mut x).deref_mut());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&mut ***(&mut &mut x)`
error: aborting due to 13 previous errors
|