-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle relative paths in module_files lints #8611
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
} else { | ||
return; | ||
}; | ||
let RealFileName::LocalPath(trim_to_src) = &cx.sess().opts.working_dir else { return }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotta love the new let-else stuff!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a Clippy contributor but I implemented the original lint, this looks good to me!
@DevinR528 as you wrote the original lint, you are a contributor. 😃 @Alexendoo this is a solid improvement, and the code is also looking good. Thank you for this! @bors r+ |
📌 Commit 10a6d87 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
The problem being that when clippy is run in the project's directory
lp
would be a relative path, this wasn't caught by the tests as therelp
is an absolute path. Being a relative path it did not start withtrim_src_path
and so was ignoredAlso allowed the removal of some
.to_os_string
/.to_owned
schangelog: Fixes [
self_named_module_files
] and [mod_module_files
] not lintingFixes #8123, cc @DevinR528