-
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
migrate paths to newly-added diagnostic items #6807
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
Thought I should do this given I added these for #6730 |
clippy_lints/src/types.rs
Outdated
@@ -307,14 +307,33 @@ fn match_type_parameter(cx: &LateContext<'_>, qpath: &QPath<'_>, path: &[&str]) | |||
None | |||
} | |||
|
|||
/// Checks if `qpath` has last segment with type parameter matching `diagnostic` |
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.
/// Checks if `qpath` has last segment with type parameter matching `diagnostic` | |
/// Checks if `qpath` has last segment with type parameter matching diagnostic item `diagnostic` |
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.
or call the variable diagnostic_item
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.
Also should this be in utils?
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.
Moved to utils, I had left it here because match_type_parameter
is also in this file and I wanted to keep them together.
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.
Which I can remove entirely if I can figure out a way to switch this use match_type_parameter(cx, qpath, &paths::BOX).is_some()
But Box is a lang item and I haven't noticed an obvious way to use a lang item there.
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.
match_type_parameter should also be in utils :)
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.
I'd be happy to move it as part of this but it is now used in a single place -- and a single place that can go away if Box
gets a diagnostic item, or we can make a version of this function to check the lang item.
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.
I would still move it, and we can try to remove it as needed. It should still be in one place, otherwise it's harder to find such things.
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.
It looks like #6823 added these same functions in a different way, and took care of a lot of the paths I was unable. Re-basing this to just include the new diagnostic items I had added.
Will still move those 2 methods.
cfd9e6e
to
a982142
Compare
☔ The latest upstream changes (presumably #6823) made this pull request unmergeable. Please resolve the merge conflicts. |
This gets rid of the following paths: * OS_STRING * TO_OWNED * TO_STRING Also removes some usages of: * PATH_BUF And the now completely unused `clippy_lints::types::is_ty_param_path`
relocate `is_ty_param_lang_item` and `is_ty_param_diagnostic_item` to `clippy_utils`
a982142
to
9bdc273
Compare
#6823 had collided with a few things I was migrating, pared this down to the ones that missed (namely: the ones I had added) |
@bors r+ Thanks! |
📌 Commit 9bdc273 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This gets rid of the following paths:
Removes some usages of:
Per #5393
also removes unneeded
is_ty_param_path
fromclippy_lints::types
and relocatesis_ty_param_lang_item
andis_ty_param_diagnostic_item
toclippy_utils
.changelog: none