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

Document pub requirement for new_without_default lint #8429

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

nsunderland1
Copy link
Contributor

fixes #8415

Also adds some UI tests that ensure that pub is required on both the struct and the field. The only thing I'm not sure about is that the lint actually checks if new is reachable, not public. To the best of my understanding, both the struct and the method need to be public for the method to be reachable for external crates (I certainly didn't manage to craft a counterexample).

changelog: Document pub requirement for [`new_without_default`] lint.

@rust-highfive
Copy link

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

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 14, 2022
@llogiq
Copy link
Contributor

llogiq commented Feb 14, 2022

Thank you! I wouldn't worry with the distinction between public and exported here. You could in theory have a struct X; pub use X, but I don't know anyone coding that way.

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 14, 2022

📌 Commit 78c2e0b has been approved by llogiq

@bors
Copy link
Collaborator

bors commented Feb 14, 2022

⌛ Testing commit 78c2e0b with merge 0836970...

@bors
Copy link
Collaborator

bors commented Feb 14, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 0836970 to master...

@bors bors merged commit 0836970 into rust-lang:master Feb 14, 2022
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.

Docs for new_without_default don't mention pub requirement
4 participants