Skip to content
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

non_canonical_clone_impl should skip proc macros #12788

Open
matthiaskrgr opened this issue May 11, 2024 · 2 comments
Open

non_canonical_clone_impl should skip proc macros #12788

matthiaskrgr opened this issue May 11, 2024 · 2 comments
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented May 11, 2024

Summary

warning: non-canonical implementation of `clone` on a `Copy` type
   --> compiler/rustc_type_ir/src/ty_kind.rs:797:10
    |
797 | #[derive(derivative::Derivative)]
    |          ^^^^^^^^^^^^^^^^^^^^^^ in this derive macro expansion
    |
   ::: /home/matthias/.cargo/registry/src/index.crates.io-6f17d22bba15001f/derivative-2.2.0/src/lib.rs:77:1
    |
77  | pub fn derivative(input: TokenStream) -> TokenStream {
    | ---------------------------------------------------- in this expansion of `#[derive(derivative::Derivative)]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_clone_impl

I guess there is not tooo much that can be one here? 😅

Lint Name

non_canonical_clone_impl

Reproducer

No response

Version

No response

Additional Labels

No response

@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels May 11, 2024
@matthiaskrgr matthiaskrgr changed the title non_canonical_clone_impl should scrip proc marcos non_canonical_clone_impl should skip proc marcos May 11, 2024
@matthiaskrgr matthiaskrgr changed the title non_canonical_clone_impl should skip proc marcos non_canonical_clone_impl should skip proc macros May 11, 2024
@Centri3 Centri3 added the good-first-issue These issues are a good way to get started with Clippy label May 11, 2024
@WeiTheShinobi
Copy link
Contributor

@rustbot claim

@WeiTheShinobi
Copy link
Contributor

WeiTheShinobi commented May 19, 2024

Hi, @matthiaskrgr
After struggling for some hour
I'm now encountering an issues
I can't write #[derive(derivative::Derivative)] in ui test.
I have no idea how to write test in this scenario.
Can you teach me how to reproduce this problem?
thank you


I found the way
keep fighting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

3 participants