Skip to content

Commit 800e0e2

Browse files
committed
Document --json=future-incompat
1 parent b72f555 commit 800e0e2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/doc/rustc/src/command-line-arguments.md

+3
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ to customize the output:
384384
argument](#option-emit), and as soon as the artifact is available on the
385385
filesystem a notification will be emitted.
386386

387+
- `future-incompat` - includes a JSON message that contains a report if the
388+
crate contains any code that may fail to compile in the future.
389+
387390
Note that it is invalid to combine the `--json` argument with the
388391
[`--color`](#option-color) argument, and it is required to combine `--json`
389392
with `--error-format=json`.

src/doc/rustc/src/json.md

+26
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,32 @@ flag][option-emit] documentation.
229229
}
230230
```
231231

232+
## Future-incompatible reports
233+
234+
If the [`--json=future-incompat`][option-json] flag is used, then a separate
235+
JSON structure will be emitted if the crate may stop compiling in the future.
236+
This contains diagnostic information about the particular warnings that may be
237+
turned into a hard error in the future. This will include the diagnostic
238+
information, even if the diagnostics have been suppressed (such as with an
239+
`#[allow]` attribute or the `--cap-lints` option).
240+
241+
```javascript
242+
{
243+
/* An array of objects describing a warning that will become a hard error
244+
in the future.
245+
*/
246+
"future_incompat_report":
247+
[
248+
{
249+
/* A diagnostic structure as defined in
250+
https://doc.rust-lang.org/rustc/json.html#diagnostics
251+
*/
252+
"diagnostic": {...},
253+
}
254+
]
255+
}
256+
```
257+
232258
[option-emit]: command-line-arguments.md#option-emit
233259
[option-error-format]: command-line-arguments.md#option-error-format
234260
[option-json]: command-line-arguments.md#option-json

0 commit comments

Comments
 (0)