You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Improve the warning messages for the #[diagnostic::on_unimplemented]
This commit improves warnings emitted for malformed on unimplemented
attributes by:
* Improving the span of the warnings
* Adding a label message to them
* Separating the messages for missing and unexpected options
* Adding a help message that says which options are supported
Copy file name to clipboardExpand all lines: tests/ui/diagnostic_namespace/on_unimplemented/ignore_unsupported_options_and_continue_to_use_fallback.stderr
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,9 @@ LL | | if(Self = ()),
8
8
... |
9
9
LL | | note = "not used yet"
10
10
LL | | )]
11
-
| |__^
11
+
| |__^ invalid option found here
12
12
|
13
+
= help: only `message`, `note` and `label` are allowed as options
13
14
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
14
15
15
16
warning: malformed `on_unimplemented` attribute
@@ -22,8 +23,9 @@ LL | | if(Self = ()),
22
23
... |
23
24
LL | | note = "not used yet"
24
25
LL | | )]
25
-
| |__^
26
+
| |__^ invalid option found here
26
27
|
28
+
= help: only `message`, `note` and `label` are allowed as options
27
29
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
0 commit comments