Open TimDiekmann opened 9 months ago
Stumbled over the same issue. It appears this is caused by having at least one component in the path which is equal to the module name, doesn't have to be lib
. Important sidenote: the path name is relevant, not the crate name.
My reproducer project for this issue contains a module file crates/example/src/example.rs
, while the crate name inside crates/example/Cargo.toml
is "some-example"
.
Summary
Reproduction repository: https://github.com/TimDiekmann/self_named_module_files-false-positive
Given the following workspace layout:
if
test-crate
is part of the outer workspace and enables theself_named_module_files
this will trigger the lint onlib.rs
Lint Name
self_named_module_files
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen: The lint should not trigger
Version
Additional Labels
No response