Skip to content

Commit 75412ce

Browse files
committed
Auto merge of #2438 - jseyfried:subcommands, r=alexcrichton
This PR moves the subcommands in `src/bin` into their own directory and ensures future compatibility with the corrected search paths for non-inline modules (see [Rust PR #32006](rust-lang/rust#32006)). r? @alexcrichton
2 parents 2eade62 + bd0e512 commit 75412ce

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/bin/cargo.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ macro_rules! each_subcommand{
9595
}
9696
}
9797

98-
mod subcommands {
99-
macro_rules! declare_mod {
100-
($name:ident) => ( pub mod $name; )
101-
}
102-
each_subcommand!(declare_mod);
98+
macro_rules! declare_mod {
99+
($name:ident) => ( pub mod $name; )
103100
}
101+
each_subcommand!(declare_mod);
104102

105103
/**
106104
The top-level `cargo` command handles configuration and project location
@@ -162,8 +160,8 @@ fn execute(flags: Flags, config: &Config) -> CliResult<Option<()>> {
162160
macro_rules! cmd{
163161
($name:ident) => (if args[1] == stringify!($name).replace("_", "-") {
164162
config.shell().set_verbose(true);
165-
let r = cargo::call_main_without_stdin(subcommands::$name::execute, config,
166-
subcommands::$name::USAGE,
163+
let r = cargo::call_main_without_stdin($name::execute, config,
164+
$name::USAGE,
167165
&args,
168166
false);
169167
cargo::process_executed(r, &mut config.shell());

0 commit comments

Comments
 (0)