rust/tests
Nick Mathewson 3d41358a55 wrong_self_convention: Match SelfKind::No more restrictively
The `wrong_self_convention` lint uses a `SelfKind` type to decide
whether a method has the right kind of "self" for its name, or whether
the kind of "self" it has makes its name confusable for a method in
a common trait.  One possibility is `SelfKind::No`, which is supposed
to mean "No `self`".

Previously, SelfKind::No matched everything _except_ Self, including
references to Self.  This patch changes it to match Self, &Self, &mut
Self, Box<Self>, and so on.

For example, this kind of method was allowed before:

```
impl S {
    // Should trigger the lint, because
    // "methods called `is_*` usually take `self` by reference or no `self`"
    fn is_foo(&mut self) -> bool { todo!() }
}
```

But since SelfKind::No matched "&mut self", no lint was triggered
(see #8142).

With this patch, the code above now gives a lint as expected.

Fixes #8142

changelog: [`wrong_self_convention`] rejects `self` references in more cases
2021-12-31 23:39:40 -05:00
..
cargo Merge commit 'cb7915b00c' into clippyup 2021-09-28 18:03:12 +01:00
ui wrong_self_convention: Match SelfKind::No more restrictively 2021-12-31 23:39:40 -05:00
ui-cargo Merge commit '27afd6ade4' into clippyup 2021-09-08 16:31:47 +02:00
ui-internal Merge commit 'a5d597637d' into clippyup 2021-12-06 12:33:31 +01:00
ui-toml Merge commit '23d11428de' into clippyup 2021-12-17 13:40:22 +01:00
ui_test Merge commit '91496c2ac6' into clippyup 2021-10-21 13:11:36 +02:00
clippy.toml Merge commit '3ae8faff4d' into clippyup 2021-06-03 08:41:37 +02:00
compile-test.rs Extend [unused_io_amount] to cover AsyncRead and AsyncWrite. 2021-12-31 12:10:59 -05:00
dogfood.rs Merge commit 'cb7915b00c' into clippyup 2021-09-28 18:03:12 +01:00
fmt.rs Merge commit 'a5d597637d' into clippyup 2021-12-06 12:33:31 +01:00
integration.rs Merge commit 'cb7915b00c' into clippyup 2021-09-28 18:03:12 +01:00
lint_message_convention.rs Merge commit '27afd6ade4' into clippyup 2021-09-08 16:31:47 +02:00
missing-test-files.rs Merge commit 'e181011378' into clippyup 2021-11-04 12:52:36 +00:00
versioncheck.rs Merge commit '27afd6ade4' into clippyup 2021-09-08 16:31:47 +02:00