Skip to content

Commit 2241fa7

Browse files
committed
Address review concern, clarifying interaction with -Dwarnings.
1 parent 93532af commit 2241fa7

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

text/0000-cargo-report-future-incompat.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -307,19 +307,25 @@ upstream dependencies. Therefore, Cargo will continue to pass
307307
`--cap-lints=allow` for non-path upstream dependencies.
308308

309309
At the same time, we want to minimize disruption to existing users of Rust.
310+
310311
Therefore, the behavior of flags that directly interact with lints, like
311312
`-Dwarnings`, will remain unchanged by this RFC.
312313

313314
For example, in our running example of `unwary`:
314-
* running `cargo rustc -- -Dwarnings` will behave the same as today
315-
(the lints in the downstream `brash` dependency will be capped
316-
and their warnings hidden), and
317-
* running `RUSTFLAGS=-Dwarnings` will also behave the same as today
318-
(the `rustc` invocation on the downstream `brash` depedency
319-
will be invoked with `-Dwarnings` and thus the build of the `brash`
320-
dependency will fail).
321-
322-
However, the Rust compiler's behavior will change slightly. Even when
315+
* running either `cargo rustc -- -Dwarnings` or `RUSTFLAGS=-Dwarnings cargo build`
316+
will invoke `rustc` itself the same way, and each `rustc` invocation will emit
317+
the same set of diagnostics that it does today for each of those cases.
318+
* Thus, the warning lints in the downstream `brash` non-path dependency will
319+
be capped, and the future-incompatiblity warnings associated with that `rustc`
320+
invocation will be hidden.
321+
* When `cargo` emits a future-incompatibility report at the end of the build,
322+
and reports that `brash` contains code that will be rejected by
323+
a future version of Rust, this report is *not* a lint, and does *not* interact
324+
with `-Dwarnings`.
325+
* In summary: getting a future-incompatibility report when you
326+
have passed `-Dwarnings` to `rustc` will *not* fail the build.
327+
328+
However, the Rust compiler's behavior *will* change slightly. Even when
323329
`--cap-lints=allow` is turned on, we need Cargo to know when a
324330
future-incompatibilty lint is triggered.
325331

0 commit comments

Comments
 (0)