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

new lint: synthetic_non_exhaustive #10559

Closed
wants to merge 1 commit into from
Closed

new lint: synthetic_non_exhaustive #10559

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 28, 2023

Closes: #10550

changelog: [synthetic_non_exhaustive]: new line

@rustbot
Copy link
Collaborator

rustbot commented Mar 28, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Jarcho (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 28, 2023
@Jarcho
Copy link
Contributor

Jarcho commented Mar 28, 2023

We already have manual_non_exhaustive. It requires that there's a single #[doc_hidden] variant with a leading underscore in the name to avoid false positives.

@ghost
Copy link
Author

ghost commented Mar 28, 2023

So if it was decided that we wanted this behaviour, would the best solution be to remove the underscore checks from manual_non_exhaustive?

I should have searched harder and found that first :) Looks like I missed some stuff like checking msrv even supports #[non_exhaustive], and creating some nicer output with span_suggestion.

@Jarcho
Copy link
Contributor

Jarcho commented Mar 28, 2023

It would probably be ok to remove the underscore check. The check to see if the variant is actually created within the defining crate should be enough to catch where #[doc(hidden)] is used to indicate a private variant.

@bors
Copy link
Contributor

bors commented Mar 30, 2023

☔ The latest upstream changes (presumably #9102) made this pull request unmergeable. Please resolve the merge conflicts.

@ghost ghost closed this Apr 8, 2023
bors added a commit that referenced this pull request Nov 22, 2023
…core-check, r=flip1995

Remove underscore check for `manual_non_exhaustive` lint

Fixes #10550.

As indicated in #10559, the underscore check should be removed.

changelog: remove underscore check for `manual_non_exhaustive` lint

r? `@blyxyas`
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc: synthetic_non_exhaustive lint
4 participants