diff --git a/src/bin/cargo/commands/report.rs b/src/bin/cargo/commands/report.rs
index cf2bbf91fc9..34a79bb8f39 100644
--- a/src/bin/cargo/commands/report.rs
+++ b/src/bin/cargo/commands/report.rs
@@ -1,5 +1,4 @@
use crate::command_prelude::*;
-use anyhow::anyhow;
use cargo::core::compiler::future_incompat::{OnDiskReports, REPORT_PREAMBLE};
use cargo::drop_println;
@@ -24,9 +23,6 @@ pub fn cli() -> App {
}
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
- if !config.nightly_features_allowed {
- return Err(anyhow!("`cargo report` can only be used on the nightly channel").into());
- }
match args.subcommand() {
("future-incompatibilities", Some(args)) => report_future_incompatibilies(config, args),
(cmd, _) => panic!("unexpected command `{}`", cmd),
diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs
index f215014edc7..505910d5fa2 100644
--- a/src/cargo/core/compiler/build_context/target_info.rs
+++ b/src/cargo/core/compiler/build_context/target_info.rs
@@ -47,6 +47,8 @@ pub struct TargetInfo {
pub rustdocflags: Vec,
/// Whether or not rustc supports the `-Csplit-debuginfo` flag.
pub supports_split_debuginfo: bool,
+ /// Whether or not rustc supports the `--json future-incompat` flag.
+ pub supports_json_future_incompat: bool,
}
/// Kind of each file generated by a Unit, part of `FileType`.
@@ -179,6 +181,15 @@ impl TargetInfo {
)
.is_ok();
+ let supports_json_future_incompat = rustc
+ .cached_output(
+ process
+ .clone()
+ .args(&["--error-format", "json", "--json", "future-incompat"]),
+ extra_fingerprint,
+ )
+ .is_ok();
+
process.arg("--print=sysroot");
process.arg("--print=cfg");
@@ -253,6 +264,7 @@ impl TargetInfo {
)?,
cfg,
supports_split_debuginfo,
+ supports_json_future_incompat,
})
}
diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs
index f3387ba181c..f201456594a 100644
--- a/src/cargo/core/compiler/future_incompat.rs
+++ b/src/cargo/core/compiler/future_incompat.rs
@@ -321,9 +321,6 @@ pub fn save_and_display_report(
bcx: &BuildContext<'_, '_>,
per_package_future_incompat_reports: &[FutureIncompatReportPackage],
) {
- if !bcx.config.cli_unstable().future_incompat_report {
- return;
- }
let should_display_message = match bcx.config.future_incompat_config() {
Ok(config) => config.should_display_message(),
Err(e) => {
diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs
index cb9b3c681ab..2c1b6c32f58 100644
--- a/src/cargo/core/compiler/mod.rs
+++ b/src/cargo/core/compiler/mod.rs
@@ -641,7 +641,7 @@ fn rustdoc(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult {
rustdoc.arg("--cfg").arg(&format!("feature=\"{}\"", feat));
}
- add_error_format_and_color(cx, &mut rustdoc, false);
+ add_error_format_and_color(cx, &mut rustdoc, unit, false);
add_allow_features(cx, &mut rustdoc);
if let Some(args) = cx.bcx.extra_args_for(unit) {
@@ -790,7 +790,12 @@ fn add_allow_features(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder) {
/// intercepting messages like rmeta artifacts, etc. rustc includes a
/// "rendered" field in the JSON message with the message properly formatted,
/// which Cargo will extract and display to the user.
-fn add_error_format_and_color(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder, pipelined: bool) {
+fn add_error_format_and_color(
+ cx: &Context<'_, '_>,
+ cmd: &mut ProcessBuilder,
+ unit: &Unit,
+ pipelined: bool,
+) {
cmd.arg("--error-format=json");
let mut json = String::from("--json=diagnostic-rendered-ansi");
if pipelined {
@@ -798,6 +803,16 @@ fn add_error_format_and_color(cx: &Context<'_, '_>, cmd: &mut ProcessBuilder, pi
// to emit a message that cargo will intercept.
json.push_str(",artifacts");
}
+ if cx
+ .bcx
+ .target_data
+ .info(unit.kind)
+ .supports_json_future_incompat
+ {
+ // Emit a future-incompat report (when supported by rustc), so we can report
+ // future-incompat dependencies to the user
+ json.push_str(",future-incompat");
+ }
match cx.bcx.build_config.message_format {
MessageFormat::Short | MessageFormat::Json { short: true, .. } => {
@@ -858,7 +873,7 @@ fn build_base_args(
edition.cmd_edition_arg(cmd);
add_path_args(bcx.ws, unit, cmd);
- add_error_format_and_color(cx, cmd, cx.rmeta_required(unit));
+ add_error_format_and_color(cx, cmd, unit, cx.rmeta_required(unit));
add_allow_features(cx, cmd);
let mut contains_dy_lib = false;
@@ -1022,10 +1037,6 @@ fn build_base_args(
.env("RUSTC_BOOTSTRAP", "1");
}
- if bcx.config.cli_unstable().future_incompat_report {
- cmd.arg("-Z").arg("emit-future-incompat-report");
- }
-
// Add `CARGO_BIN_` environment variables for building tests.
if unit.target.is_test() || unit.target.is_bench() {
for bin_target in unit
diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs
index 27da65247b2..9016038ddbf 100644
--- a/src/cargo/core/features.rs
+++ b/src/cargo/core/features.rs
@@ -637,7 +637,6 @@ unstable_cli_options!(
doctest_in_workspace: bool = ("Compile doctests with paths relative to the workspace root"),
doctest_xcompile: bool = ("Compile and run doctests for non-host target using runner config"),
dual_proc_macros: bool = ("Build proc-macros for both the host and the target"),
- future_incompat_report: bool = ("Enable creation of a future-incompat report for all dependencies"),
features: Option> = (HIDDEN),
jobserver_per_rustc: bool = (HIDDEN),
minimal_versions: bool = ("Resolve minimal dependency versions instead of maximum"),
@@ -705,6 +704,9 @@ const STABILIZED_NAMED_PROFILES: &str = "The named-profiles feature is now alway
See https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#custom-profiles \
for more information";
+const STABILIZED_FUTURE_INCOMPAT_REPORT: &str =
+ "The future-incompat-report feature is now always enabled.";
+
fn deserialize_build_std<'de, D>(deserializer: D) -> Result
+
See cargo-report(1)
+
+
## ENVIRONMENT
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md
index 70cd1bafa6e..1a8bce6bd3a 100644
--- a/src/doc/src/commands/cargo-check.md
+++ b/src/doc/src/commands/cargo-check.md
@@ -345,6 +345,12 @@ for more information about how toolchain overrides work.
the number of CPUs.
+
--future-incompat-report
+
Displays a future-incompat report for any future-incompatible warnings
+produced during execution of this command
+
+
+
## ENVIRONMENT
diff --git a/src/doc/src/commands/cargo-report.md b/src/doc/src/commands/cargo-report.md
new file mode 100644
index 00000000000..5df2303e6af
--- /dev/null
+++ b/src/doc/src/commands/cargo-report.md
@@ -0,0 +1,43 @@
+# cargo-report(1)
+
+## NAME
+
+cargo-report - Generate and display various kinds of reports
+
+## SYNOPSIS
+
+`cargo report` _type_ [_options_]
+
+### DESCRIPTION
+
+Displays a report of the given _type_ - currently, only `future-incompat` is supported
+
+## OPTIONS
+
+
+
+
--idid
+
Show the report with the specified Cargo-generated id
+
+
+
-pspec...
+
--packagespec...
+
Only display a report for the specified package
+
+
+
+
+## EXAMPLES
+
+1. Display the latest future-incompat report:
+
+ cargo report future-incompat
+
+2. Display the latest future-incompat report for a specific package:
+
+ cargo report future-incompat --package my-dep:0.0.1
+
+## SEE ALSO
+[Future incompat report](../reference/future-incompat-report.html)
+
+[cargo(1)](cargo.html)
diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md
index 5601425e6a9..a90e3074ce4 100644
--- a/src/doc/src/commands/cargo-rustc.md
+++ b/src/doc/src/commands/cargo-rustc.md
@@ -337,6 +337,12 @@ for more information about how toolchain overrides work.
the number of CPUs.
+
--future-incompat-report
+
Displays a future-incompat report for any future-incompatible warnings
+produced during execution of this command
+
+
+
## ENVIRONMENT
diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md
index 1bc44e5ebfc..4b55dd54a25 100644
--- a/src/doc/src/commands/cargo-test.md
+++ b/src/doc/src/commands/cargo-test.md
@@ -434,6 +434,12 @@ includes an option to control the number of threads used:
the number of CPUs.
+
--future-incompat-report
+
Displays a future-incompat report for any future-incompatible warnings
+produced during execution of this command
+
+
+
diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md
index 65918cc5d3e..540dfb206a3 100644
--- a/src/doc/src/reference/config.md
+++ b/src/doc/src/reference/config.md
@@ -87,6 +87,9 @@ ENV_VAR_NAME_2 = { value = "value", force = true }
# Value is relative to .cargo directory containing `config.toml`, make absolute
ENV_VAR_NAME_3 = { value = "relative/path", relative = true }
+[future-incompat-report]
+frequency = 'always' # when to display a notification about a future incompat report
+
[cargo-new]
vcs = "none" # VCS to use ('git', 'hg', 'pijul', 'fossil', 'none')
@@ -504,6 +507,20 @@ TMPDIR = { value = "/home/tmp", force = true }
OPENSSL_DIR = { value = "vendor/openssl", relative = true }
```
+### `[future-incompat-report]`
+
+The `[future-incompat-report]` table controls setting for [future incompat reporting](future-incompat-report.md)
+
+#### `future-incompat-report.frequency`
+* Type: string
+* Default: "always"
+* Environment: `CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY`
+
+Controls how often we display a notification to the terminal when a future incompat report is available. Possible values:
+
+* `always` (default): Always display a notification when a command (e.g. `cargo build`) produces a future incompat report
+* `never`: Never display a notification
+
#### `[http]`
The `[http]` table defines settings for HTTP behavior. This includes fetching
diff --git a/src/doc/src/reference/environment-variables.md b/src/doc/src/reference/environment-variables.md
index 88f3c94e440..ad9cfab1b6c 100644
--- a/src/doc/src/reference/environment-variables.md
+++ b/src/doc/src/reference/environment-variables.md
@@ -83,6 +83,7 @@ supported environment variables are:
* `CARGO_BUILD_DEP_INFO_BASEDIR` — Dep-info relative directory, see [`build.dep-info-basedir`].
* `CARGO_BUILD_PIPELINING` — Whether or not to use `rustc` pipelining, see [`build.pipelining`].
* `CARGO_CARGO_NEW_VCS` — The default source control system with [`cargo new`], see [`cargo-new.vcs`].
+* `CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY` - How often we should generate a future incompat report notifcation, see [`future-incompat-report.frequency`].
* `CARGO_HTTP_DEBUG` — Enables HTTP debugging, see [`http.debug`].
* `CARGO_HTTP_PROXY` — Enables HTTP proxy, see [`http.proxy`].
* `CARGO_HTTP_TIMEOUT` — The HTTP timeout, see [`http.timeout`].
@@ -144,6 +145,7 @@ supported environment variables are:
[`cargo-new.name`]: config.md#cargo-newname
[`cargo-new.email`]: config.md#cargo-newemail
[`cargo-new.vcs`]: config.md#cargo-newvcs
+[`future-incompat-report.frequency`]: config.md#future-incompat-reportfrequency
[`http.debug`]: config.md#httpdebug
[`http.proxy`]: config.md#httpproxy
[`http.timeout`]: config.md#httptimeout
diff --git a/src/doc/src/reference/future-incompat-report.md b/src/doc/src/reference/future-incompat-report.md
new file mode 100644
index 00000000000..5ec93618fbd
--- /dev/null
+++ b/src/doc/src/reference/future-incompat-report.md
@@ -0,0 +1,24 @@
+### Future incompat report
+
+Cargo checks for future-incompatible warnings in all dependencies. These are warnings for
+changes that may become hard errors in the future, causing the dependency to
+stop building in a future version of rustc. If any warnings are found, a small
+notice is displayed indicating that the warnings were found, and provides
+instructions on how to display a full report.
+
+A full report can be displayed with the `cargo report future-incompatibilities
+--id ID` command, or by running the build again with
+the `--future-incompat-report` flag. The developer should then update their
+dependencies to a version where the issue is fixed, or work with the
+developers of the dependencies to help resolve the issue.
+
+This feature can be configured through a `[future-incompat-report]`
+section in `.cargo/config`. Currently, the supported options are:
+
+```
+[future-incompat-report]
+frequency = FREQUENCY
+```
+
+The supported values for `FREQUENCY` are 'always` and 'never', which control
+whether or not a message is printed out at the end of `cargo build` / `cargo check`.
diff --git a/src/doc/src/reference/index.md b/src/doc/src/reference/index.md
index ced87fa61b7..298647a57a3 100644
--- a/src/doc/src/reference/index.md
+++ b/src/doc/src/reference/index.md
@@ -21,4 +21,5 @@ The reference covers the details of various areas of Cargo.
* [Registries](registries.md)
* [Dependency Resolution](resolver.md)
* [SemVer Compatibility](semver.md)
+* [Future incompat report](future-incompat-report.md)
* [Unstable Features](unstable.md)
diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md
index 6b254fd3297..ec26f31d2cd 100644
--- a/src/doc/src/reference/unstable.md
+++ b/src/doc/src/reference/unstable.md
@@ -94,7 +94,6 @@ Each new feature described below should explain how to use it.
* [Build-plan](#build-plan) — Emits JSON information on which commands will be run.
* [timings](#timings) — Generates a report on how long individual dependencies took to run.
* [unit-graph](#unit-graph) — Emits JSON for Cargo's internal graph structure.
- * [future incompat report](#future-incompat-report) — Displays a report for future incompatibilities that may error in the future.
* [`cargo rustc --print`](#rustc---print) — Calls rustc with `--print` to display information from rustc.
* Configuration
* [config-cli](#config-cli) — Adds the ability to pass configuration options on the command-line.
@@ -1143,35 +1142,6 @@ cargo logout -Z credential-process
[crates.io]: https://crates.io/
[config file]: config.md
-### future incompat report
-* RFC: [#2834](https://github.com/rust-lang/rfcs/blob/master/text/2834-cargo-report-future-incompat.md)
-* rustc Tracking Issue: [#71249](https://github.com/rust-lang/rust/issues/71249)
-
-The `-Z future-incompat-report` flag causes Cargo to check for
-future-incompatible warnings in all dependencies. These are warnings for
-changes that may become hard errors in the future, causing the dependency to
-stop building in a future version of rustc. If any warnings are found, a small
-notice is displayed indicating that the warnings were found, and provides
-instructions on how to display a full report.
-
-A full report can be displayed with the `cargo report future-incompatibilities
--Z future-incompat-report --id ID` command, or by running the build again with
-the `--future-incompat-report` flag. The developer should then update their
-dependencies to a version where the issue is fixed, or work with the
-developers of the dependencies to help resolve the issue.
-
-This feature can be configured through a `[future-incompat-report]`
-section in `.cargo/config`. Currently, the supported options are:
-
-```
-[future-incompat-report]
-frequency = FREQUENCY
-```
-
-The supported values for `FREQUENCY` are 'always` and 'never', which control
-whether or not a message is printed out at the end of `cargo build` / `cargo check`.
-
-
### `cargo config`
* Original Issue: [#2362](https://github.com/rust-lang/cargo/issues/2362)
@@ -1403,6 +1373,11 @@ See [`cargo fix --edition`](../commands/cargo-fix.md) and [The Edition Guide](..
Custom named profiles have been stabilized in the 1.57 release. See the
[profiles chapter](profiles.md#custom-profiles) for more information.
+### Future incompat report
+
+Support for generating a future-incompat report has been stabilized
+in the 1.59 release. See the [future incompat report chapter](future-incompat-report.md)
+for more information.
### scrape-examples
diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1
index 832c70686d2..c258b7e06c6 100644
--- a/src/etc/man/cargo-build.1
+++ b/src/etc/man/cargo-build.1
@@ -359,6 +359,14 @@ Number of parallel jobs to run. May also be specified with the
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1
index 420a04212e5..0fe36e554d5 100644
--- a/src/etc/man/cargo-check.1
+++ b/src/etc/man/cargo-check.1
@@ -349,6 +349,14 @@ Number of parallel jobs to run. May also be specified with the
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff --git a/src/etc/man/cargo-report.1 b/src/etc/man/cargo-report.1
new file mode 100644
index 00000000000..d72bedbad69
--- /dev/null
+++ b/src/etc/man/cargo-report.1
@@ -0,0 +1,48 @@
+'\" t
+.TH "CARGO\-REPORT" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.SH "NAME"
+cargo\-report \- Generate and display various kinds of reports
+.SH "SYNOPSIS"
+\fBcargo report\fR \fItype\fR [\fIoptions\fR]
+.SS "DESCRIPTION"
+Displays a report of the given \fItype\fR \- currently, only \fBfuture\-incompat\fR is supported
+.SH "OPTIONS"
+.sp
+\fB\-\-id\fR \fIid\fR
+.RS 4
+Show the report with the specified Cargo\-generated id
+.RE
+.sp
+\fB\-p\fR \fIspec\fR\&...,
+\fB\-\-package\fR \fIspec\fR\&...
+.RS 4
+Only display a report for the specified package
+.RE
+.SH "EXAMPLES"
+.sp
+.RS 4
+\h'-04' 1.\h'+01'Display the latest future\-incompat report:
+.sp
+.RS 4
+.nf
+cargo report future\-incompat
+.fi
+.RE
+.RE
+.sp
+.RS 4
+\h'-04' 2.\h'+01'Display the latest future\-incompat report for a specific package:
+.sp
+.RS 4
+.nf
+cargo report future\-incompat \-\-package my\-dep:0.0.1
+.fi
+.RE
+.RE
+.SH "SEE ALSO"
+\fIFuture incompat report\fR
+.sp
+\fBcargo\fR(1)
diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1
index f73643102be..a705cb79750 100644
--- a/src/etc/man/cargo-rustc.1
+++ b/src/etc/man/cargo-rustc.1
@@ -344,6 +344,14 @@ Number of parallel jobs to run. May also be specified with the
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1
index eaa000305d3..ae5f527223c 100644
--- a/src/etc/man/cargo-test.1
+++ b/src/etc/man/cargo-test.1
@@ -453,6 +453,14 @@ Number of parallel jobs to run. May also be specified with the
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff --git a/tests/testsuite/future_incompat_report.rs b/tests/testsuite/future_incompat_report.rs
index 8c10f06f0a3..c6cb2ffd324 100644
--- a/tests/testsuite/future_incompat_report.rs
+++ b/tests/testsuite/future_incompat_report.rs
@@ -25,7 +25,7 @@ fn simple_project() -> Project {
}
#[cargo_test]
-fn no_output_on_stable() {
+fn output_on_stable() {
if !is_nightly() {
// -Zfuture-incompat-test requires nightly (permanently)
return;
@@ -33,39 +33,23 @@ fn no_output_on_stable() {
let p = simple_project();
p.cargo("check")
- // Even though rustc emits the report, cargo ignores it without -Z.
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
- .with_stderr_does_not_contain("[..]cargo report[..]")
+ .with_stderr_contains("[..]cargo report[..]")
.run();
}
+// This feature is stable, and should not be gated
#[cargo_test]
-fn gate_future_incompat_report() {
+fn no_gate_future_incompat_report() {
let p = simple_project();
p.cargo("build --future-incompat-report")
- .with_stderr_contains("error: the `--future-incompat-report` flag is unstable[..]")
- .with_status(101)
- .run();
-
- // Both `-Z future-incompat-report` and `-Z unstable-opts` are required
- p.cargo("build --future-incompat-report -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
- .with_stderr_contains("error: the `--future-incompat-report` flag is unstable[..]")
- .with_status(101)
- .run();
-
- p.cargo("build --future-incompat-report -Z unstable-options")
- .masquerade_as_nightly_cargo()
- .with_stderr_contains(
- "error: Usage of `--future-incompat-report` requires `-Z future-incompat-report`",
- )
- .with_status(101)
+ .with_status(0)
.run();
p.cargo("report future-incompatibilities --id foo")
- .with_stderr_contains("error: `cargo report` can only be used on the nightly channel")
+ .with_stderr_contains("error: no reports are currently available")
.with_status(101)
.run();
}
@@ -83,8 +67,7 @@ fn test_zero_future_incompat() {
.build();
// No note if --future-incompat-report is not specified.
- p.cargo("build -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo("build")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr(
"\
@@ -94,8 +77,7 @@ fn test_zero_future_incompat() {
)
.run();
- p.cargo("build --future-incompat-report -Z unstable-options -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo("build --future-incompat-report")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr(
"\
@@ -117,8 +99,7 @@ fn test_single_crate() {
for command in &["build", "check", "rustc", "test"] {
let check_has_future_compat = || {
- p.cargo(command).arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command)
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: foo v0.0.0 [..]")
@@ -147,8 +128,6 @@ frequency = 'never'
",
);
p.cargo(command)
- .arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
.with_stderr_does_not_contain("[..]rejected[..]")
@@ -156,8 +135,7 @@ frequency = 'never'
.run();
// Check that passing `--future-incompat-report` overrides `frequency = 'never'`
- p.cargo(command).arg("-Zfuture-incompat-report").arg("-Zunstable-options").arg("--future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command).arg("--future-incompat-report")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: foo v0.0.0 [..]")
@@ -197,8 +175,7 @@ fn test_multi_crate() {
.build();
for command in &["build", "check", "rustc", "test"] {
- p.cargo(command).arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command)
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_does_not_contain(FUTURE_OUTPUT)
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: first-dep v0.0.1, second-dep v0.0.2")
@@ -209,23 +186,20 @@ fn test_multi_crate() {
.with_stderr_does_not_contain("[..]-p[..]")
.run();
- p.cargo(command).arg("-Zunstable-options").arg("-Zfuture-incompat-report").arg("--future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command).arg("--future-incompat-report")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: first-dep v0.0.1, second-dep v0.0.2")
.with_stderr_contains(" - first-dep:0.0.1")
.with_stderr_contains(" - second-dep:0.0.2")
.run();
- p.cargo("report future-incompatibilities").arg("--package").arg("first-dep:0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo("report future-incompatibilities").arg("--package").arg("first-dep:0.0.1")
.with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
.with_stdout_contains(FUTURE_OUTPUT)
.with_stdout_does_not_contain("[..]second-dep-0.0.2/src[..]")
.run();
- p.cargo("report future-incompatibilities").arg("--package").arg("second-dep:0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo("report future-incompatibilities").arg("--package").arg("second-dep:0.0.2")
.with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
.with_stdout_contains(FUTURE_OUTPUT)
.with_stdout_does_not_contain("[..]first-dep-0.0.1/src[..]")
@@ -234,9 +208,8 @@ fn test_multi_crate() {
// Test that passing the correct id via '--id' doesn't generate a warning message
let output = p
- .cargo("build -Z future-incompat-report")
+ .cargo("build")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
- .masquerade_as_nightly_cargo()
.exec_with_output()
.unwrap();
@@ -256,16 +229,14 @@ fn test_multi_crate() {
// Strip off the trailing '`' included in the output
let id: String = id.chars().take_while(|c| *c != '`').collect();
- p.cargo(&format!("report future-incompatibilities -Z future-incompat-report --id {}", id))
- .masquerade_as_nightly_cargo()
+ p.cargo(&format!("report future-incompatibilities --id {}", id))
.with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
.with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
.run();
// Test without --id, and also the full output of the report.
let output = p
- .cargo("report future-incompat -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
+ .cargo("report future-incompat")
.exec_with_output()
.unwrap();
let output = std::str::from_utf8(&output.stdout).unwrap();
@@ -305,17 +276,17 @@ fn color() {
let p = simple_project();
- p.cargo("check -Zfuture-incompat-report")
+ p.cargo("check")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.masquerade_as_nightly_cargo()
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report")
+ p.cargo("report future-incompatibilities")
.masquerade_as_nightly_cargo()
.with_stdout_does_not_contain("[..]\x1b[[..]")
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report")
+ p.cargo("report future-incompatibilities")
.masquerade_as_nightly_cargo()
.env("CARGO_TERM_COLOR", "always")
.with_stdout_contains("[..]\x1b[[..]")
@@ -331,24 +302,24 @@ fn bad_ids() {
let p = simple_project();
- p.cargo("report future-incompatibilities -Z future-incompat-report --id 1")
+ p.cargo("report future-incompatibilities --id 1")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr("error: no reports are currently available")
.run();
- p.cargo("check -Zfuture-incompat-report")
+ p.cargo("check")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.masquerade_as_nightly_cargo()
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report --id foo")
+ p.cargo("report future-incompatibilities --id foo")
.masquerade_as_nightly_cargo()
.with_status(1)
.with_stderr("error: Invalid value: could not parse `foo` as a number")
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report --id 7")
+ p.cargo("report future-incompatibilities --id 7")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr(
@@ -426,7 +397,7 @@ big_update v1.0.0 has the following newer versions available: 2.0.0
with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1
";
- p.cargo("check -Zfuture-incompat-report -Zunstable-options --future-incompat-report")
+ p.cargo("check --future-incompat-report")
.masquerade_as_nightly_cargo()
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(update_message)