Skip to content

Commit 2d2062a

Browse files
committed
rustc_expand: make diagnostic translatable
1 parent 3710d30 commit 2d2062a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

compiler/rustc_expand/messages.ftl

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ expand_attribute_meta_item =
1010
expand_attribute_single_word =
1111
attribute must only be a single word
1212
13+
expand_attributes_on_expressions_experimental =
14+
attributes on expressions are experimental
15+
.help_outer_doc = `///` is used for outer documentation comments; for a plain comment, use `//`.
16+
.help_inner_doc = `//!` is used for inner documentation comments; for a plain comment, use `//` by removing the `!` or inserting a space in between them: `// !`
17+
1318
expand_attributes_wrong_form =
1419
attribute must be of form: `attributes(foo, bar)`
1520

compiler/rustc_expand/src/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,14 @@ impl<'a> StripUnconfigured<'a> {
383383
&self.sess,
384384
sym::stmt_expr_attributes,
385385
attr.span,
386-
"attributes on expressions are experimental",
386+
crate::fluent_generated::expand_attributes_on_expressions_experimental,
387387
);
388388

389389
if attr.is_doc_comment() {
390390
err.help(if attr.style == AttrStyle::Outer {
391-
"`///` is used for outer documentation comments; for a plain comment, use `//`."
391+
crate::fluent_generated::expand_help_outer_doc
392392
} else {
393-
"`//!` is used for inner documentation comments; for a plain comment, use `//` by removing the `!` or inserting a space in between them: `// !`"
393+
crate::fluent_generated::expand_help_inner_doc
394394
});
395395
}
396396

0 commit comments

Comments
 (0)