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

Add suppress_derive_clone struct attribute #326

Closed
wants to merge 1 commit into from

Conversation

mathstuf
Copy link
Contributor

This attribute suppresses the default-generated derive(Clone). This may be necessary where derive(Clone) copies constraints in an unsatisfiable way.

See: https://smallcultfollowing.com/babysteps//blog/2022/04/12/implied-bounds-and-perfect-derive/
See: rust-lang/rust#26925
Fixes: #325


I tried running the compile-fail tests but couldn't seem to get them to appear when using RUSTFLAGS='--cfg compiletests' even though it seemed like it was building the required dependencies. Let's see what GHA says…

@mathstuf mathstuf force-pushed the suppress-clone-derive branch 3 times, most recently from d30884a to 3b55bb5 Compare June 27, 2024 17:22
This attribute suppresses the default-generated `derive(Clone)`. This
may be necessary where `derive(Clone)` copies constraints in an
unsatisfiable way.

See: https://smallcultfollowing.com/babysteps//blog/2022/04/12/implied-bounds-and-perfect-derive/
See: rust-lang/rust#26925
Fixes: colin-kiegel#325
@mathstuf
Copy link
Contributor Author

clippy seems to be unhappy about generated code; ignoring.

@mathstuf
Copy link
Contributor Author

I ran into issues actually using this. It was easier to instead just pattern = "owned".

@mathstuf mathstuf closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support suppressing default Clone derivation
1 participant