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

feat: Explicitly list items to re-export from derive #5675

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

Noratrieb
Copy link
Contributor

This allows rustc to give a nice note about activating feature when it has not been activated.

Before:

error[E0433]: failed to resolve: could not find `Parser` in `clap`
 --> ssh/src/main.rs:1:16
  |
1 | #[derive(clap::Parser, Debug)]
  |                ^^^^^^ could not find `Parser` in `clap`

After:

error[E0433]: failed to resolve: could not find `Parser` in `clap`
  --> ssh/src/main.rs:1:16
   |
1  | #[derive(clap::Parser, Debug)]
   |                ^^^^^^ could not find `Parser` in `clap`
   |
note: found an item that was configured out
  --> /home/nora/.cargo/git/checkouts/clap-cf0796c5889852a8/ec804fa/src/lib.rs:93:35
   |
93 | pub use clap_derive::{self, Args, Parser, Subcommand, ValueEnum};
   |                                   ^^^^^^
note: the item is gated behind the `derive` feature
  --> /home/nora/.cargo/git/checkouts/clap-cf0796c5889852a8/ec804fa/src/lib.rs:89:7
   |
89 | #[cfg(feature = "derive")]
   |       ^^^^^^^^^^^^^^^^^^

@Noratrieb Noratrieb changed the title Explicitly list items to re-export from derive feat: Explicitly list items to re-export from derive Aug 15, 2024
src/lib.rs Outdated Show resolved Hide resolved
This allows rustc to give a nice note about activating
the derive feature when it has not been activated.
@epage epage merged commit 679fb1d into clap-rs:master Aug 15, 2024
23 checks passed
@epage
Copy link
Member

epage commented Aug 15, 2024

Thanks!

@Noratrieb Noratrieb deleted the patch-1 branch August 15, 2024 22:21
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