-
Notifications
You must be signed in to change notification settings - Fork 152
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
impl functions should use visibility of original struct / enum #24
Labels
bug
This is a BUG. The fix may be released in a patch version even if considered breaking
Comments
These functions are considered implementation details. Why would you need access to them? |
I don't need access to them. The codegen of your crate does. #![feature(proc_macro)]
extern crate structopt;
extern crate structopt_derive;
mod options {
#[derive(Debug, ::structopt_derive::StructOpt)]
pub struct Options {
#[structopt(subcommand)]
pub subcommand: ::subcommands::SubCommand,
}
}
mod subcommands {
#[derive(Debug, ::structopt_derive::StructOpt)]
pub enum SubCommand {
#[structopt(name = "foo", about = "foo")]
Foo {
#[structopt(help = "foo", required = true)]
bars: Vec<String>,
},
}
}
fn main() {
}
|
Ha, great, a compilation bug with an example. I didn't get the problem on the read of the issue. Thanks. |
TeXitoi
added
the
bug
This is a BUG. The fix may be released in a patch version even if considered breaking
label
Oct 25, 2017
Eijebong
pushed a commit
to Eijebong/structopt
that referenced
this issue
Jan 2, 2019
* edge/core pixels optimization * added debug_asserts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The functions like
augment_clap
andfrom_subcommand
are currently generated without any explicit visibility. This means if the struct / enum is inside amod
then the functions are private to themod
, even if the struct itself ispub
.Instead these functions should use the visibility of the struct / enum.
The text was updated successfully, but these errors were encountered: