Commit d568387
committed
Auto merge of rust-lang#7396 - ranweiler:zero-offset, r=Manishearth
Fix invocation of `zst_offset` lint
The `zst_offset` lint was broken by a refactoring regression in 2108387. In the invocation of the `zst_offset` check [here](rust-lang/rust-clippy@2108387#diff-7f73f6fe28c04b654223c09c42fe02937d2351fc58a91d21ab812aaf6f9b185dR1927), we shadow the already-destructured receiver `recv`, and accidentally pass the first argument of the method as if it were the receiver.
This was not caught because the UI test expectation was never correct (a bad cast obscured the actual test result).
This PR:
- Fixes the existing test expectation
- Tests both `const` and `mut` raw pointers
- Passes the actual receiver to the lint's implementation
Fixes rust-lang#7395.
changelog: Fix [`zst_offset`] invocation and testFile tree
3 files changed
+63
-14
lines changed- clippy_lints/src/methods
- tests/ui
3 files changed
+63
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2036 | 2036 | | |
2037 | 2037 | | |
2038 | 2038 | | |
2039 | | - | |
| 2039 | + | |
2040 | 2040 | | |
2041 | 2041 | | |
2042 | 2042 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 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 | + | |
6 | 50 | | |
7 | | - | |
| 51 | + | |
8 | 52 | | |
9 | | - | |
| |||
0 commit comments