1
Fork 0

Rollup merge of #138700 - xizheyin:issue-138612, r=Nadrieril

Suggest `-Whelp` when pass `--print lints` to rustc

Closes #138612
This commit is contained in:
Matthias Krüger 2025-03-20 15:36:19 +01:00 committed by GitHub
commit 28fc422f30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 0 deletions

View file

@ -2082,6 +2082,12 @@ fn emit_unknown_print_request_help(early_dcx: &EarlyDiagCtxt, req: &str) -> ! {
let mut diag = early_dcx.early_struct_fatal(format!("unknown print request: `{req}`"));
#[allow(rustc::diagnostic_outside_of_impl)]
diag.help(format!("valid print requests are: {prints}"));
if req == "lints" {
diag.help(format!("use `-Whelp` to print a list of lints"));
}
diag.help(format!("for more information, see the rustc book: https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information"));
diag.emit()
}