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

Allow clippy::redundant_pub_crate #284

Merged
merged 1 commit into from
Oct 2, 2020

Conversation

dnaka91
Copy link
Contributor

@dnaka91 dnaka91 commented Oct 1, 2020

This is my first PR to this project so please bear with me.

While using this crate in my project I noticed that the clippy::redundant_pub_crate (part of clippy::nursery) came up when I was using the derive macro in a module within a binary crate.

For example my trimmed down project layout is like this:

src/main.rs
src/services/log.rs <-- using the pin_project derive macro here creates a clippy warning

This change allows the clippy::redundant_pub_crate lint on all generated code to silence the lint messages. I hope this is the right spot to add the #[allow(...)] attribute.

@dnaka91 dnaka91 requested a review from taiki-e as a code owner October 1, 2020 14:16
Copy link
Owner

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you run the following command to fix expandtest failure?

rm -r tests/expand/tests/expand/*.expanded.rs && cargo +nightly test --manifest-path tests/expand/Cargo.toml

or (after rebase)

bash scripts/expandtest.sh

When using pin-project within a module of a binary crate the
clippy::redundant_pub_crate (part of clippy::nursery) is triggered
due to the pub(crate) which is not needed in this case.

This change allows the clippy::redundant_pub_crate lint on all
generated code to silence the lint messages.
@dnaka91
Copy link
Contributor Author

dnaka91 commented Oct 2, 2020

Thank you for the quick reply.
I rebased and updated the expansion tests.

@taiki-e
Copy link
Owner

taiki-e commented Oct 2, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 2, 2020

Build succeeded:

@bors bors bot merged commit 2f535d0 into taiki-e:master Oct 2, 2020
@dnaka91 dnaka91 deleted the clippy-pub-crate-lint branch October 2, 2020 06:44
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.

2 participants