-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint
explicit_auto_deref
without a leading borrow
- Loading branch information
Showing
11 changed files
with
101 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,172 +1,184 @@ | ||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:62:20 | ||
--> $DIR/explicit_auto_deref.rs:63:20 | ||
| | ||
LL | let _: &str = &*s; | ||
| ^^ help: try this: `s` | ||
| | ||
= note: `-D clippy::explicit-auto-deref` implied by `-D warnings` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:66:12 | ||
--> $DIR/explicit_auto_deref.rs:67:12 | ||
| | ||
LL | f_str(&*s); | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:70:14 | ||
--> $DIR/explicit_auto_deref.rs:71:14 | ||
| | ||
LL | f_str_t(&*s, &*s); // Don't lint second param. | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:73:25 | ||
--> $DIR/explicit_auto_deref.rs:74:25 | ||
| | ||
LL | let _: &Box<i32> = &**b; | ||
| ^^^ help: try this: `b` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:79:8 | ||
--> $DIR/explicit_auto_deref.rs:80:8 | ||
| | ||
LL | c(&*s); | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:85:9 | ||
--> $DIR/explicit_auto_deref.rs:86:9 | ||
| | ||
LL | &**x | ||
| ^^^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:89:11 | ||
--> $DIR/explicit_auto_deref.rs:90:11 | ||
| | ||
LL | { &**x } | ||
| ^^^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:93:9 | ||
--> $DIR/explicit_auto_deref.rs:94:9 | ||
| | ||
LL | &**{ x } | ||
| ^^^^^^^^ help: try this: `{ x }` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:97:9 | ||
--> $DIR/explicit_auto_deref.rs:98:9 | ||
| | ||
LL | &***x | ||
| ^^^^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:114:13 | ||
--> $DIR/explicit_auto_deref.rs:115:13 | ||
| | ||
LL | f1(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:115:13 | ||
--> $DIR/explicit_auto_deref.rs:116:13 | ||
| | ||
LL | f2(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:116:13 | ||
--> $DIR/explicit_auto_deref.rs:117:13 | ||
| | ||
LL | f3(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:117:28 | ||
--> $DIR/explicit_auto_deref.rs:118:28 | ||
| | ||
LL | f4.callable_str()(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:118:13 | ||
--> $DIR/explicit_auto_deref.rs:119:13 | ||
| | ||
LL | f5(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:119:13 | ||
--> $DIR/explicit_auto_deref.rs:120:13 | ||
| | ||
LL | f6(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:120:28 | ||
--> $DIR/explicit_auto_deref.rs:121:28 | ||
| | ||
LL | f7.callable_str()(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:121:26 | ||
--> $DIR/explicit_auto_deref.rs:122:26 | ||
| | ||
LL | f8.callable_t()(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:122:13 | ||
--> $DIR/explicit_auto_deref.rs:123:13 | ||
| | ||
LL | f9(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:123:14 | ||
--> $DIR/explicit_auto_deref.rs:124:14 | ||
| | ||
LL | f10(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:124:27 | ||
--> $DIR/explicit_auto_deref.rs:125:27 | ||
| | ||
LL | f11.callable_t()(&*x); | ||
| ^^ help: try this: `x` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:128:17 | ||
--> $DIR/explicit_auto_deref.rs:129:17 | ||
| | ||
LL | let _ = S1(&*s); | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:133:22 | ||
--> $DIR/explicit_auto_deref.rs:134:22 | ||
| | ||
LL | let _ = S2 { s: &*s }; | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:149:30 | ||
--> $DIR/explicit_auto_deref.rs:150:30 | ||
| | ||
LL | let _ = Self::S1(&**s); | ||
| ^^^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:150:35 | ||
--> $DIR/explicit_auto_deref.rs:151:35 | ||
| | ||
LL | let _ = Self::S2 { s: &**s }; | ||
| ^^^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:153:21 | ||
--> $DIR/explicit_auto_deref.rs:154:21 | ||
| | ||
LL | let _ = E1::S1(&*s); | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:154:26 | ||
--> $DIR/explicit_auto_deref.rs:155:26 | ||
| | ||
LL | let _ = E1::S2 { s: &*s }; | ||
| ^^ help: try this: `s` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:172:13 | ||
--> $DIR/explicit_auto_deref.rs:173:13 | ||
| | ||
LL | let _ = (*b).foo; | ||
| ^^^^ help: try this: `b` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:173:13 | ||
--> $DIR/explicit_auto_deref.rs:174:13 | ||
| | ||
LL | let _ = (**b).foo; | ||
| ^^^^^ help: try this: `b` | ||
|
||
error: aborting due to 28 previous errors | ||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:189:19 | ||
| | ||
LL | let _ = f_str(*ref_str); | ||
| ^^^^^^^^ help: try this: `ref_str` | ||
|
||
error: deref which would be done by auto-deref | ||
--> $DIR/explicit_auto_deref.rs:191:19 | ||
| | ||
LL | let _ = f_str(**ref_ref_str); | ||
| ^^^^^^^^^^^^^ help: try this: `ref_ref_str` | ||
|
||
error: aborting due to 30 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.