about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/messages.ftl
diff options
context:
space:
mode:
authorGeorg Semmler <github@weiznich.de>2023-10-19 08:44:15 +0200
committerGeorg Semmler <github@weiznich.de>2023-10-19 15:00:47 +0200
commit9017b974eef3b43cb4a0c781cc24404b896b0ce5 (patch)
tree24b1117e0c1337f1fb581447044a2bf577281430 /compiler/rustc_trait_selection/messages.ftl
parent020d00867a0129fe77d02fb7f07d6bc96a7033ff (diff)
downloadrust-9017b974eef3b43cb4a0c781cc24404b896b0ce5.tar.gz
rust-9017b974eef3b43cb4a0c781cc24404b896b0ce5.zip
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
Diffstat (limited to 'compiler/rustc_trait_selection/messages.ftl')
-rw-r--r--compiler/rustc_trait_selection/messages.ftl5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/messages.ftl b/compiler/rustc_trait_selection/messages.ftl
index 20253b32add..a9792ca2795 100644
--- a/compiler/rustc_trait_selection/messages.ftl
+++ b/compiler/rustc_trait_selection/messages.ftl
@@ -28,6 +28,11 @@ trait_selection_invalid_on_clause_in_rustc_on_unimplemented = invalid `on`-claus
     .label = invalid on-clause here
 
 trait_selection_malformed_on_unimplemented_attr = malformed `on_unimplemented` attribute
+    .help = only `message`, `note` and `label` are allowed as options
+    .label = invalid option found here
+
+trait_selection_missing_options_for_on_unimplemented_attr = missing options for `on_unimplemented` attribute
+    .help = at least one of the `message`, `note` and `label` options are expected
 
 trait_selection_negative_positive_conflict = found both positive and negative implementation of trait `{$trait_desc}`{$self_desc ->
         [none] {""}