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

display: enum match arms: use 'Self' (to fix incompatibility with #![deny(clippy::use_self)] #192

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

phip1611
Copy link
Contributor

@phip1611 phip1611 commented Jun 9, 2022

This PR makes the generated code compatible with a global setting of #![deny(clippy::use_self)] by using Self::Variant instead of EnumName::Variant.

@tyranron
Copy link
Collaborator

@phip1611 well, this change doesn't survive the MSRV check.

@JelteF are we OK to bump up MSRV to at least 1.51 (last 10 versions)? Or do you see some sense to keep MSRV such outdated?
Additionally, I'd like to place #[automatically_derived] attribute on the every generated code, so the style linters may omit the generated code (doesn't solve this issue due to the Clippy bug, however).

@phip1611
Copy link
Contributor Author

btw, I fixed the latest (unrelated) clippy error as well.

@JelteF JelteF added this to the 1.0.0 milestone Jun 10, 2022
@JelteF
Copy link
Owner

JelteF commented Jun 11, 2022

I am not opposed to bumping MSRV to something less ancient, but I would like to do that only when increasing the major version of the library. Marking this lib as 1.0 is way overdue anyway.

I cleaned up the 1.0.0 milestone to only contain things that require breaking changes, it turned out that was only a single thing.

@tyranron
Copy link
Collaborator

@JelteF in case we don't want to do 1.x releases yet, we always may release just 0.100.x one, containing the necessary breaking changes.

@phip1611
Copy link
Contributor Author

any update here? @tyranron @JelteF

@tyranron
Copy link
Collaborator

@phip1611 bumping MSRV is OK, as we're going to release 1.0.0.

@phip1611
Copy link
Contributor Author

I rebased the MR onto the latest master. Can you approve the CI, please?

@JelteF JelteF merged commit 4fb92fe into JelteF:master Oct 4, 2022
@phip1611 phip1611 deleted the use-self-instead-of-enum-name branch October 5, 2022 03:32
JelteF pushed a commit that referenced this pull request Oct 5, 2022
Revealed from
#192 (comment)


## Synopsis

The code, generated by `derive_more`, often becomes a subject of
complains for strict style linters.

## Solution

Use `#[automatically_derived]` attribute on any generated code, so the
code style linters will omit the generated code.
liveseed added a commit to liveseed/derive_more that referenced this pull request Aug 20, 2024
Revealed from
JelteF/derive_more#192 (comment)


## Synopsis

The code, generated by `derive_more`, often becomes a subject of
complains for strict style linters.

## Solution

Use `#[automatically_derived]` attribute on any generated code, so the
code style linters will omit the generated code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants