File tree Expand file tree Collapse file tree
compiler/rustc_passes/src
tests/ui/diagnostic_namespace/on_missing_args Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1359,9 +1359,7 @@ pub(crate) struct OnMoveMalformedFormatLiterals {
13591359
13601360#[ derive( Diagnostic ) ]
13611361#[ diag( "unknown parameter `{$name}`" ) ]
1362- #[ help(
1363- r#"the only supported format parameter for `#[diagnostic::on_missing_args]` is {"`{This}`"}"#
1364- ) ]
1362+ #[ help( r#"use {"`{This}`"} to refer to the macro name"# ) ]
13651363pub ( crate ) struct OnMissingArgsMalformedFormatLiterals {
13661364 pub name : Symbol ,
13671365}
Original file line number Diff line number Diff line change 22#![ feature( diagnostic_on_missing_args) ]
33
44#[ diagnostic:: on_missing_args(
5- message = "pair ! is missing {T} " ,
5+ message = "{T} ! is missing arguments " ,
66 //~^ WARN unknown parameter `T`
77) ]
88macro_rules! pair {
Original file line number Diff line number Diff line change 11warning: unknown parameter `T`
2- --> $DIR/report_warning_on_invalid_formats.rs:5:34
2+ --> $DIR/report_warning_on_invalid_formats.rs:5:17
33 |
4- LL | message = "pair ! is missing {T} ",
5- | ^
4+ LL | message = "{T} ! is missing arguments ",
5+ | ^
66 |
7- = help: the only supported format parameter for `#[diagnostic::on_missing_args]` is `{This}`
7+ = help: use `{This}` to refer to the macro name
88 = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default
99
1010warning: 1 warning emitted
You can’t perform that action at this time.
0 commit comments