lint-docs: Add some extra detail to the error message.

This will hopefully help users figure out what was wrong and how
to fix it.
This commit is contained in:
Eric Huss 2020-11-28 13:35:36 -08:00
parent d2d91b42a5
commit 228510b0ec

View File

@ -4,6 +4,19 @@ use std::path::PathBuf;
fn main() {
if let Err(e) = doit() {
eprintln!("error: {}", e);
eprintln!(
"
This error was generated by the lint-docs tool.
This tool extracts documentation for lints from the source code and places
them in the rustc book. See the declare_lint! documentation
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html
for an example of the format of documentation this tool expects.
To re-run these tests, run: ./x.py test --keep-stage=0 src/tools/lint-docs
The --keep-stage flag should be used if you have already built the compiler
and are only modifying the doc comments to avoid rebuilding the compiler.
"
);
std::process::exit(1);
}
}