-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Clippy Book Chapter Updates Reborn: Trait Checking #10626
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
Conversation
r? @dswij (rustbot has picked a reviewer for you, use r? to override) |
r? @flip1995 |
|
||
impl LateLintPass<'_> for CheckTokioAsyncReadExtTrait { | ||
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { | ||
if match_trait_method(cx, expr, &paths::TOKIO_IO_ASYNCREADEXT) { |
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.
NIT: please use a path that is not to an external crate (I don't want to give the idea that adding paths to external crates is accepted. We try to avoid that as much as possible)
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.
Ok, just a question. Why is this specific path accepted?
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.
We used to be less strict on external crates/didn't have a policy. Deprecating useful lints for those crates now isn't worth the hassle. So we have some legacy code from that time.
☔ The latest upstream changes (presumably #10652) made this pull request unmergeable. Please resolve the merge conflicts. |
ab06ae7
to
1c06375
Compare
☔ The latest upstream changes (presumably #10644) made this pull request unmergeable. Please resolve the merge conflicts. |
5e982c2
to
2a3f75b
Compare
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.
This LGTM.
All of the remaining 3 PRs are now ready to be merged. However, some links need to be figured out I think. @blyxyas Can I ask you to do that for those 3 PRs and then r=me
on them in whatever order makes the most sense.
After all those PRs are merged, I think the only thing left to do is address the FIXME
s in those chapters and cross link those chapters.
[`clippy_utils::paths`][paths] with the `match_trait_method` to determine trait | ||
implementation. | ||
|
||
> **Note**: This approach should be avoided if possible, the best thing to do would be to make a PR to [`rust-lang/rust`][rust]. |
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.
> **Note**: This approach should be avoided if possible, the best thing to do would be to make a PR to [`rust-lang/rust`][rust]. | |
> **Note**: This approach should be avoided if possible, the best thing to do would be to make a PR to [`rust-lang/rust`][rust] adding a diagnostic item. |
I'll fix them. Btw, are you talking about the link order in |
Mainly missing links in |
@bors r=flip1995 |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR adds a new chapter to the book: "Trait Checking". No major changes from the source (just some typos, re-phrasing, the usual).
Notes
changelog: Add a new "Trait Checking" chapter to the book