Skip to content

Commit 6208c52

Browse files
committed
Auto merge of #13741 - epage:msrv-ignore-help, r=Muscraft
fix(help): Generalize --ignore-rust-version ### What does this PR try to resolve? This is part of #9930 and updates for the help to accommodate #13738 and adding `--ignore-rust-version` to `cargo update` for when they are stable This includes - Moving `--ignore-rust-version` to be under the "Manifest options" header - Generalizing the help description ### How should we test and review this PR? ### Additional information
2 parents 7e31f62 + a0ba729 commit 6208c52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+610
-653
lines changed

Diff for: src/bin/cargo/commands/add.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,10 @@ While you can use the crate in your implementation, it cannot be referenced in y
8585
Example uses:
8686
- Depending on multiple versions of a crate
8787
- Depend on crates with the same name from different registries"),
88-
flag(
89-
"ignore-rust-version",
90-
"Ignore `rust-version` specification in packages"
91-
),
9288
])
9389
.arg_manifest_path_without_unsupported_path_tip()
9490
.arg_package("Package to modify")
91+
.arg_ignore_rust_version()
9592
.arg_dry_run("Don't actually write the manifest")
9693
.arg_silent_suggestion()
9794
.next_help_heading("Source")

Diff for: src/bin/cargo/commands/bench.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub fn cli() -> Command {
2222
"no-fail-fast",
2323
"Run all benchmarks regardless of failure",
2424
))
25-
.arg_ignore_rust_version()
2625
.arg_message_format()
2726
.arg_silent_suggestion()
2827
.arg_package_spec(
@@ -51,6 +50,7 @@ pub fn cli() -> Command {
5150
.arg_unit_graph()
5251
.arg_timings()
5352
.arg_manifest_path()
53+
.arg_ignore_rust_version()
5454
.after_help(color_print::cstr!(
5555
"Run `<cyan,bold>cargo help bench</>` for more detailed information.\n"
5656
))

Diff for: src/bin/cargo/commands/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub fn cli() -> Command {
77
// subcommand aliases are handled in aliased_command()
88
// .alias("b")
99
.about("Compile a local package and all of its dependencies")
10-
.arg_ignore_rust_version()
1110
.arg_future_incompat_report()
1211
.arg_message_format()
1312
.arg_silent_suggestion()
@@ -40,6 +39,7 @@ pub fn cli() -> Command {
4039
.arg_unit_graph()
4140
.arg_timings()
4241
.arg_manifest_path()
42+
.arg_ignore_rust_version()
4343
.after_help(color_print::cstr!(
4444
"Run `<cyan,bold>cargo help build</>` for more detailed information.\n"
4545
))

Diff for: src/bin/cargo/commands/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub fn cli() -> Command {
77
// subcommand aliases are handled in aliased_command()
88
// .alias("c")
99
.about("Check a local package and all of its dependencies for errors")
10-
.arg_ignore_rust_version()
1110
.arg_future_incompat_report()
1211
.arg_message_format()
1312
.arg_silent_suggestion()
@@ -37,6 +36,7 @@ pub fn cli() -> Command {
3736
.arg_unit_graph()
3837
.arg_timings()
3938
.arg_manifest_path()
39+
.arg_ignore_rust_version()
4040
.after_help(color_print::cstr!(
4141
"Run `<cyan,bold>cargo help check</>` for more detailed information.\n"
4242
))

Diff for: src/bin/cargo/commands/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub fn cli() -> Command {
1616
"Don't build documentation for dependencies",
1717
))
1818
.arg(flag("document-private-items", "Document private items"))
19-
.arg_ignore_rust_version()
2019
.arg_message_format()
2120
.arg_silent_suggestion()
2221
.arg_package_spec(
@@ -40,6 +39,7 @@ pub fn cli() -> Command {
4039
.arg_unit_graph()
4140
.arg_timings()
4241
.arg_manifest_path()
42+
.arg_ignore_rust_version()
4343
.after_help(color_print::cstr!(
4444
"Run `<cyan,bold>cargo help doc</>` for more detailed information.\n"
4545
))

Diff for: src/bin/cargo/commands/fix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub fn cli() -> Command {
2626
"allow-staged",
2727
"Fix code even if the working directory has staged changes",
2828
))
29-
.arg_ignore_rust_version()
3029
.arg_message_format()
3130
.arg_silent_suggestion()
3231
.arg_package_spec(
@@ -54,6 +53,7 @@ pub fn cli() -> Command {
5453
.arg_target_dir()
5554
.arg_timings()
5655
.arg_manifest_path()
56+
.arg_ignore_rust_version()
5757
.after_help(color_print::cstr!(
5858
"Run `<cyan,bold>cargo help fix</>` for more detailed information.\n"
5959
))

Diff for: src/bin/cargo/commands/run.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub fn cli() -> Command {
2424
.num_args(0..)
2525
.trailing_var_arg(true),
2626
)
27-
.arg_ignore_rust_version()
2827
.arg_message_format()
2928
.arg_silent_suggestion()
3029
.arg_package("Package with the target to run")
@@ -39,6 +38,7 @@ pub fn cli() -> Command {
3938
.arg_target_triple("Build for the target triple")
4039
.arg_target_dir()
4140
.arg_manifest_path()
41+
.arg_ignore_rust_version()
4242
.arg_unit_graph()
4343
.arg_timings()
4444
.after_help(color_print::cstr!(

Diff for: src/bin/cargo/commands/rustc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub fn cli() -> Command {
2828
"Comma separated list of types of crates for the compiler to emit",
2929
))
3030
.arg_future_incompat_report()
31-
.arg_ignore_rust_version()
3231
.arg_message_format()
3332
.arg_silent_suggestion()
3433
.arg_package("Package to build")
@@ -53,6 +52,7 @@ pub fn cli() -> Command {
5352
.arg_unit_graph()
5453
.arg_timings()
5554
.arg_manifest_path()
55+
.arg_ignore_rust_version()
5656
.after_help(color_print::cstr!(
5757
"Run `<cyan,bold>cargo help rustc</>` for more detailed information.\n"
5858
))

Diff for: src/bin/cargo/commands/rustdoc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub fn cli() -> Command {
1616
"open",
1717
"Opens the docs in a browser after the operation",
1818
))
19-
.arg_ignore_rust_version()
2019
.arg_message_format()
2120
.arg_silent_suggestion()
2221
.arg_package("Package to document")
@@ -46,6 +45,7 @@ pub fn cli() -> Command {
4645
.arg_unit_graph()
4746
.arg_timings()
4847
.arg_manifest_path()
48+
.arg_ignore_rust_version()
4949
.after_help(color_print::cstr!(
5050
"Run `<cyan,bold>cargo help rustdoc</>` for more detailed information.\n"
5151
))

Diff for: src/bin/cargo/commands/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ pub fn cli() -> Command {
2121
.arg(flag("doc", "Test only this library's documentation"))
2222
.arg(flag("no-run", "Compile, but don't run tests"))
2323
.arg(flag("no-fail-fast", "Run all tests regardless of failure"))
24-
.arg_ignore_rust_version()
2524
.arg_future_incompat_report()
2625
.arg_message_format()
2726
.arg(
@@ -58,6 +57,7 @@ pub fn cli() -> Command {
5857
.arg_unit_graph()
5958
.arg_timings()
6059
.arg_manifest_path()
60+
.arg_ignore_rust_version()
6161
.after_help(color_print::cstr!(
6262
"Run `<cyan,bold>cargo help test</>` for more detailed information.\n\
6363
Run `<cyan,bold>cargo test -- --help</>` for test binary options.\n",

Diff for: src/cargo/util/command_prelude.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,13 @@ pub trait CommandExt: Sized {
352352
}
353353

354354
fn arg_ignore_rust_version(self) -> Self {
355-
self._arg(flag(
356-
"ignore-rust-version",
357-
"Ignore `rust-version` specification in packages",
358-
))
355+
self._arg(
356+
flag(
357+
"ignore-rust-version",
358+
"Ignore `rust-version` specification in packages",
359+
)
360+
.help_heading(heading::MANIFEST_OPTIONS),
361+
)
359362
}
360363

361364
fn arg_future_incompat_report(self) -> Self {

Diff for: src/doc/man/cargo-add.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ crates, the features for a specific crate may be enabled with
139139
which enables all specified features.
140140
{{/option}}
141141

142-
{{#option "`--ignore-rust-version`" }}
143-
Ignore `rust-version` specification in packages.
144-
{{/option}}
145-
146142
{{/options}}
147143

148144

@@ -161,6 +157,8 @@ Ignore `rust-version` specification in packages.
161157
Add dependencies to only the specified package.
162158
{{/option}}
163159

160+
{{> options-ignore-rust-version }}
161+
164162
{{> options-locked }}
165163
{{/options}}
166164

Diff for: src/doc/man/cargo-bench.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ for more information on per-target settings.
112112

113113
{{> options-profile }}
114114

115-
{{> options-ignore-rust-version }}
116-
117115
{{> options-timings }}
118116

119117
{{/options}}
@@ -145,6 +143,8 @@ passing `--nocapture` to the benchmark binaries:
145143
{{#options}}
146144
{{> options-manifest-path }}
147145

146+
{{> options-ignore-rust-version }}
147+
148148
{{> options-locked }}
149149
{{/options}}
150150

Diff for: src/doc/man/cargo-build.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ they have `required-features` that are missing.
4141

4242
{{> options-profile }}
4343

44-
{{> options-ignore-rust-version }}
45-
4644
{{> options-timings }}
4745

4846
{{/options}}
@@ -86,6 +84,8 @@ See <https://github.com/rust-lang/cargo/issues/5579> for more information.
8684
{{#options}}
8785
{{> options-manifest-path }}
8886

87+
{{> options-ignore-rust-version }}
88+
8989
{{> options-locked }}
9090
{{/options}}
9191

Diff for: src/doc/man/cargo-check.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ they have `required-features` that are missing.
4444

4545
{{> options-profile-legacy-check }}
4646

47-
{{> options-ignore-rust-version }}
48-
4947
{{> options-timings }}
5048

5149
{{/options}}
@@ -69,6 +67,8 @@ they have `required-features` that are missing.
6967
{{#options}}
7068
{{> options-manifest-path }}
7169

70+
{{> options-ignore-rust-version }}
71+
7272
{{> options-locked }}
7373
{{/options}}
7474

Diff for: src/doc/man/cargo-doc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ and supports common Unix glob patterns.
7878

7979
{{> options-profile }}
8080

81-
{{> options-ignore-rust-version }}
82-
8381
{{> options-timings }}
8482

8583
{{/options}}
@@ -103,6 +101,8 @@ and supports common Unix glob patterns.
103101
{{#options}}
104102
{{> options-manifest-path }}
105103

104+
{{> options-ignore-rust-version }}
105+
106106
{{> options-locked }}
107107
{{/options}}
108108

Diff for: src/doc/man/cargo-fix.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ When no target selection options are given, `cargo fix` will fix all targets
124124

125125
{{> options-profile-legacy-check }}
126126

127-
{{> options-ignore-rust-version }}
128-
129127
{{> options-timings }}
130128

131129
{{/options}}
@@ -149,6 +147,8 @@ When no target selection options are given, `cargo fix` will fix all targets
149147
{{#options}}
150148
{{> options-manifest-path }}
151149

150+
{{> options-ignore-rust-version }}
151+
152152
{{> options-locked }}
153153
{{/options}}
154154

Diff for: src/doc/man/cargo-install.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ See also the `--profile` option for choosing a specific profile by name.
180180

181181
{{> options-profile }}
182182

183-
{{> options-ignore-rust-version }}
184-
185183
{{> options-timings }}
186184

187185
{{/options}}
188186

189187
### Manifest Options
190188

191189
{{#options}}
190+
{{> options-ignore-rust-version }}
191+
192192
{{> options-locked }}
193193
{{/options}}
194194

Diff for: src/doc/man/cargo-run.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ Run the specified example.
5757

5858
{{> options-profile }}
5959

60-
{{> options-ignore-rust-version }}
61-
6260
{{> options-timings }}
6361

6462
{{/options}}
@@ -85,6 +83,8 @@ Run the specified example.
8583

8684
{{> options-manifest-path }}
8785

86+
{{> options-ignore-rust-version }}
87+
8888
{{> options-locked }}
8989

9090
{{/options}}

Diff for: src/doc/man/cargo-rustc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ The `rustc` subcommand will treat the following named profiles with special beha
6969
See [the reference](../reference/profiles.html) for more details on profiles.
7070
{{/option}}
7171

72-
{{> options-ignore-rust-version }}
73-
7472
{{> options-timings }}
7573

7674
{{#option "`--crate-type` _crate-type_"}}
@@ -110,6 +108,8 @@ This flag only works when building a `lib` or `example` library target.
110108

111109
{{> options-manifest-path }}
112110

111+
{{> options-ignore-rust-version }}
112+
113113
{{> options-locked }}
114114

115115
{{/options}}

Diff for: src/doc/man/cargo-rustdoc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ if its name is the same as the lib target. Binaries are skipped if they have
6767

6868
{{> options-profile }}
6969

70-
{{> options-ignore-rust-version }}
71-
7270
{{> options-timings }}
7371

7472
{{/options}}
@@ -92,6 +90,8 @@ if its name is the same as the lib target. Binaries are skipped if they have
9290
{{#options}}
9391
{{> options-manifest-path }}
9492

93+
{{> options-ignore-rust-version }}
94+
9595
{{> options-locked }}
9696
{{/options}}
9797

Diff for: src/doc/man/cargo-test.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ target options.
136136

137137
{{> options-profile }}
138138

139-
{{> options-ignore-rust-version }}
140-
141139
{{> options-timings }}
142140

143141
{{/options}}
@@ -170,6 +168,8 @@ results readable. Test output can be recovered (e.g., for debugging) by passing
170168

171169
{{> options-manifest-path }}
172170

171+
{{> options-ignore-rust-version }}
172+
173173
{{> options-locked }}
174174

175175
{{/options}}

Diff for: src/doc/man/generated_txt/cargo-add.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ OPTIONS
128128
be enabled with package-name/feature-name syntax. This flag may be
129129
specified multiple times, which enables all specified features.
130130

131-
--ignore-rust-version
132-
Ignore rust-version specification in packages.
133-
134131
Display Options
135132
-v, --verbose
136133
Use verbose output. May be specified twice for “very verbose”
@@ -165,6 +162,9 @@ OPTIONS
165162
-p spec, --package spec
166163
Add dependencies to only the specified package.
167164

165+
--ignore-rust-version
166+
Ignore rust-version specification in packages.
167+
168168
--locked
169169
Asserts that the exact same dependencies and versions are used as
170170
when the existing Cargo.lock file was originally generated. Cargo

0 commit comments

Comments
 (0)