Commit c642d0c
committed
Auto merge of rust-lang#12696 - smoelius:fix-is_test_module_or_function, r=Alexendoo
Fix `is_test_module_or_function`
The rustdoc comment for `is_test_module_or_function` states: https://github.com/rust-lang/rust-clippy/blob/2795a6018944a5918b7d276267165484f5d62d6a/clippy_utils/src/lib.rs#L2561-L2566
Given `item`, the function calls `is_in_test_function` with `item.hir_id()`. However, `is_in_test_function` considers only `item`'s parents, not `item` itself. This PR fixes the problem.
The `test_with_disallowed_name` test fails without the fix, but passes once applied.
changelog: none2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2505 | 2505 | | |
2506 | 2506 | | |
2507 | 2507 | | |
2508 | | - | |
2509 | | - | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
2510 | 2511 | | |
2511 | 2512 | | |
2512 | 2513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments