Skip to content

Commit f085df3

Browse files
authored
Unrolled build for rust-lang#121788
Rollup merge of rust-lang#121788 - klensy:clap-deprecated-fix, r=clubby789 bootstrap: fix clap deprecated warnings Run 'cargo check --features clap/deprecated' and fix warnings
2 parents 71a7b66 + f2d9bfb commit f085df3

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/bootstrap/src/core/builder.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -642,22 +642,22 @@ impl<'a> ShouldRun<'a> {
642642

643643
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
644644
pub enum Kind {
645-
#[clap(alias = "b")]
645+
#[value(alias = "b")]
646646
Build,
647-
#[clap(alias = "c")]
647+
#[value(alias = "c")]
648648
Check,
649649
Clippy,
650650
Fix,
651651
Format,
652-
#[clap(alias = "t")]
652+
#[value(alias = "t")]
653653
Test,
654654
Bench,
655-
#[clap(alias = "d")]
655+
#[value(alias = "d")]
656656
Doc,
657657
Clean,
658658
Dist,
659659
Install,
660-
#[clap(alias = "r")]
660+
#[value(alias = "r")]
661661
Run,
662662
Setup,
663663
Suggest,

src/bootstrap/src/core/config/flags.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub enum Warnings {
3131

3232
/// Deserialized version of all flags for this compile.
3333
#[derive(Debug, Parser)]
34-
#[clap(
34+
#[command(
3535
override_usage = "x.py <subcommand> [options] [<paths>...]",
3636
disable_help_subcommand(true),
3737
about = "",
@@ -118,7 +118,7 @@ pub struct Flags {
118118
// This overrides the deny-warnings configuration option,
119119
// which passes -Dwarnings to the compiler invocations.
120120
#[arg(global(true), long)]
121-
#[clap(value_enum, default_value_t=Warnings::Default, value_name = "deny|warn")]
121+
#[arg(value_enum, default_value_t=Warnings::Default, value_name = "deny|warn")]
122122
/// if value is deny, will deny warnings
123123
/// if value is warn, will emit warnings
124124
/// otherwise, use the default configured behaviour
@@ -132,7 +132,7 @@ pub struct Flags {
132132
pub json_output: bool,
133133

134134
#[arg(global(true), long, value_name = "STYLE")]
135-
#[clap(value_enum, default_value_t = Color::Auto)]
135+
#[arg(value_enum, default_value_t = Color::Auto)]
136136
/// whether to use color in cargo and rustc output
137137
pub color: Color,
138138

@@ -188,7 +188,7 @@ impl Flags {
188188
let it = std::iter::once(&first).chain(args.iter());
189189
// We need to check for `<cmd> -h -v`, in which case we list the paths
190190
#[derive(Parser)]
191-
#[clap(disable_help_flag(true))]
191+
#[command(disable_help_flag(true))]
192192
struct HelpVerboseOnly {
193193
#[arg(short, long)]
194194
help: bool,
@@ -218,7 +218,7 @@ impl Flags {
218218

219219
#[derive(Debug, Clone, Default, clap::Subcommand)]
220220
pub enum Subcommand {
221-
#[clap(aliases = ["b"], long_about = "\n
221+
#[command(aliases = ["b"], long_about = "\n
222222
Arguments:
223223
This subcommand accepts a number of paths to directories to the crates
224224
and/or artifacts to compile. For example, for a quick build of a usable
@@ -233,7 +233,7 @@ pub enum Subcommand {
233233
/// Compile either the compiler or libraries
234234
#[default]
235235
Build,
236-
#[clap(aliases = ["c"], long_about = "\n
236+
#[command(aliases = ["c"], long_about = "\n
237237
Arguments:
238238
This subcommand accepts a number of paths to directories to the crates
239239
and/or artifacts to compile. For example:
@@ -246,7 +246,7 @@ pub enum Subcommand {
246246
all_targets: bool,
247247
},
248248
/// Run Clippy (uses rustup/cargo-installed clippy binary)
249-
#[clap(long_about = "\n
249+
#[command(long_about = "\n
250250
Arguments:
251251
This subcommand accepts a number of paths to directories to the crates
252252
and/or artifacts to run clippy against. For example:
@@ -273,14 +273,14 @@ pub enum Subcommand {
273273
forbid: Vec<String>,
274274
},
275275
/// Run cargo fix
276-
#[clap(long_about = "\n
276+
#[command(long_about = "\n
277277
Arguments:
278278
This subcommand accepts a number of paths to directories to the crates
279279
and/or artifacts to run `cargo fix` against. For example:
280280
./x.py fix library/core
281281
./x.py fix library/core library/proc_macro")]
282282
Fix,
283-
#[clap(
283+
#[command(
284284
name = "fmt",
285285
long_about = "\n
286286
Arguments:
@@ -295,7 +295,7 @@ pub enum Subcommand {
295295
#[arg(long)]
296296
check: bool,
297297
},
298-
#[clap(aliases = ["d"], long_about = "\n
298+
#[command(aliases = ["d"], long_about = "\n
299299
Arguments:
300300
This subcommand accepts a number of paths to directories of documentation
301301
to build. For example:
@@ -316,7 +316,7 @@ pub enum Subcommand {
316316
/// render the documentation in JSON format in addition to the usual HTML format
317317
json: bool,
318318
},
319-
#[clap(aliases = ["t"], long_about = "\n
319+
#[command(aliases = ["t"], long_about = "\n
320320
Arguments:
321321
This subcommand accepts a number of paths to test directories that
322322
should be compiled and run. For example:
@@ -400,7 +400,7 @@ pub enum Subcommand {
400400
Dist,
401401
/// Install distribution artifacts
402402
Install,
403-
#[clap(aliases = ["r"], long_about = "\n
403+
#[command(aliases = ["r"], long_about = "\n
404404
Arguments:
405405
This subcommand accepts a number of paths to tools to build and run. For
406406
example:
@@ -413,7 +413,7 @@ pub enum Subcommand {
413413
args: Vec<String>,
414414
},
415415
/// Set up the environment for development
416-
#[clap(long_about = format!(
416+
#[command(long_about = format!(
417417
"\n
418418
x.py setup creates a `config.toml` which changes the defaults for x.py itself,
419419
as well as setting up a git pre-push hook, VS Code config and toolchain link.
@@ -434,7 +434,7 @@ Arguments:
434434
profile: Option<PathBuf>,
435435
},
436436
/// Suggest a subset of tests to run, based on modified files
437-
#[clap(long_about = "\n")]
437+
#[command(long_about = "\n")]
438438
Suggest {
439439
/// run suggested tests
440440
#[arg(long)]

0 commit comments

Comments
 (0)