rust/tests
bors b97eaab558 Auto merge of #11387 - y21:issue11371, r=blyxyas
[`unnecessary_unwrap`]: lint on `.as_ref().unwrap()`

Closes #11371

This turned out to be a little more code than I originally thought, because the lint also makes sure to not lint if the user tries to mutate the option:
```rs
if option.is_some() {
  option = None;
  option.unwrap(); // don't lint here
}
```
... which means that even if we taught this lint to recognize `.as_mut()`, it would *still* not lint because that would count as a mutation. So we need to allow `.as_mut()` calls but reject other kinds of mutations.
Unfortunately it doesn't look like this is possible with `is_potentially_mutated` (seeing what kind of mutation happened).
This replaces it with a custom little visitor that does basically what it did before, but also allows `.as_mut()`.

changelog: [`unnecessary_unwrap`]: lint on `.as_ref().unwrap()`
2023-08-28 20:29:42 +00:00
..
test_utils Revert "Dogfood missing_assert_message on Clippy" 2023-03-08 08:51:50 +00:00
ui Auto merge of #11387 - y21:issue11371, r=blyxyas 2023-08-28 20:29:42 +00:00
ui-cargo Merge commit '5436dba826' into clippyup 2023-07-31 23:53:53 +02:00
ui-internal Update ui test crate to auto-detect aux build crate kind 2023-08-11 14:02:35 +00:00
ui-toml Remove redundant auxiliary test files 2023-08-25 14:25:49 +00:00
workspace_test Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
check-fmt.rs Merge commit 'f51aade56f' into clippyup 2022-08-31 09:24:45 -04:00
clippy.toml
compile-test.rs Use ui_test's Windows path backslash heuristic 2023-08-14 15:59:00 +00:00
dogfood.rs Merge commit '371120bdbf' into clippyup 2023-05-05 17:45:49 +02:00
headers.rs Make a panic message more informative if binary files are accidentally created somewhere in the test folder 2023-08-11 14:01:53 +00:00
integration.rs Merge commit '5436dba826' into clippyup 2023-07-31 23:53:53 +02:00
lint_message_convention.rs Merge commit 'd9c24d1b1e' into clippyup 2023-07-17 10:22:32 +02:00
missing-test-files.rs Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00
versioncheck.rs Merge commit '4bdfb0741d' into clippyup 2022-12-17 14:12:54 +01:00
workspace.rs Merge commit '37f4c1725d' into clippyup 2023-07-02 14:59:02 +02:00