-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
#[expect(...)]
doen't catch lints from different check_*
function
#97660
Comments
#[expect(...)]
doen't catch lints from wrong check_*
function#[expect(...)]
doen't catch lints from different check_*
function
@rustbot claim. I'll go through these lints one by one. The first two were caused by wrong emission functions on Clippy's side. Todo List:
See: https://github.com/xFrednet/rust-clippy/tree/rust-97660-catch-emissions-with-expect for the current progress
|
…, r=Jarcho Fix some `#[expect]` lint interaction Fixing the first few lints that aren't caught by `#[expect]`. The root cause of these examples was, that the lint was emitted at the wrong location. --- changelog: none r? `@Jarcho` cc: rust-lang/rust#97660
The next step for this issue is to adapt the linting interface of rustc to allow the manual fulfillment of expectations. Then I have to take a look at the last few lints, but they should all be covered by these changes. @Jarcho, have you also looked at rustc lints or just at Clippy's lints? 🙃 |
It doesn't look like any of the rustc lints need to be changed. At least the behaviour of |
…ng, r=Jarcho Fix `#[expect]` for most clippy lints This PR fixes most `#[expect]` - lint interactions listed in rust-lang/rust#97660. [My comment in the issue](rust-lang/rust#97660 (comment)) shows the current progress (Once this is merged). I plan to work on `duplicate_mod` and `multiple_inherent_impl` and leave the rest for later. I feel like stabilizing the feature is more important than fixing the last few nits, which currently also don't work with `#[allow]`. --- changelog: none r? `@Jarcho` cc: rust-lang/rust#97660
…n-magic, r=wesleywiser Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? `@wesleywiser` cc: rust-lang#97660, rust-lang#85549 And I guess that's it. Here have a magical unicorn 🦄
…n-magic, r=wesleywiser Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? ``@wesleywiser`` cc: rust-lang#97660, rust-lang#85549 And I guess that's it. Here have a magical unicorn 🦄
…n-magic, r=wesleywiser Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? ```@wesleywiser``` cc: rust-lang#97660, rust-lang#85549 And I guess that's it. Here have a magical unicorn 🦄
…n-magic, r=wesleywiser Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? `@wesleywiser` cc: rust-lang#97660, rust-lang#85549 And I guess that's it. Here have a magical unicorn 🦄
…r=wesleywiser Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? `@wesleywiser` cc: rust-lang/rust#97660, rust-lang/rust#85549 And I guess that's it. Here have a magical unicorn 🦄
I believe this issue can be closed now. All of these have been the result of suboptimal handling in Clippy. Most of these should be fixed or tracked in a new issue in Clippy. @Jarcho Could you close it, if you agree? 🙃 |
Closing this as rest of lints are tracked here |
Some lints are emitted from a from a different from the area they are linted. e.g.
clippy::ptr_arg
is linting fromcheck_body
, but it can be allowed from the argument (fn foo(#[allow(clippy::ptr_arg)] x: &Vec<u32>) {}
).The following lints in clippy (and probably more) lint from different
check_*
functions:needless_borrow
ref_binding_to_ref
duplicate_mod
multiple_inherent_impl
macro_use_imports
manual_non_exhaustive
same_name_method
async_yields_async
await_holding_lock
await_holding_refcell
await_holding_invalid_type
default_numeric_fallback
ptr_arg
redundant_clone
logic_bug
nonminimal_bool
boxed_local
implicit_return
needless_return
unnecessary_unwrap
panicking_unwrap
Some of these don't actually work with
allow
at a narrower scope either, but some of them check to see if the lint has been allowed on the target item before emitting the lint.cc #54503
The text was updated successfully, but these errors were encountered: