Rollup merge of #124333 - Urgau:better-bad-print, r=fmease
Improve diagnostic for unknown `--print` request This PR improves the diagnostic when encountering a unknown `--print` request. It also moves the run-make test to a simple UI test.
This commit is contained in:
commit
f46b828b55
6 changed files with 11 additions and 10 deletions
|
@ -1888,9 +1888,12 @@ fn collect_print_requests(
|
|||
let prints =
|
||||
PRINT_KINDS.iter().map(|(name, _)| format!("`{name}`")).collect::<Vec<_>>();
|
||||
let prints = prints.join(", ");
|
||||
early_dcx.early_fatal(format!(
|
||||
"unknown print request `{req}`. Valid print requests are: {prints}"
|
||||
));
|
||||
|
||||
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}"));
|
||||
diag.emit()
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue