]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #7396 - ranweiler:zero-offset, r=Manishearth
authorbors <bors@rust-lang.org>
Wed, 23 Jun 2021 22:22:39 +0000 (22:22 +0000)
committerbors <bors@rust-lang.org>
Wed, 23 Jun 2021 22:22:39 +0000 (22:22 +0000)
Fix invocation of `zst_offset` lint

The `zst_offset` lint was broken by a refactoring regression in 21083875d211c29fcfa4a21fcd66d4601d2b618b. In the invocation of the `zst_offset` check [here](https://github.com/rust-lang/rust-clippy/commit/21083875d211c29fcfa4a21fcd66d4601d2b618b#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 #7395.

changelog: Fix [`zst_offset`] invocation and test


Trivial merge