Skip to content

Commit

Permalink
rustc_passes: make some messages in check_attr translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Aug 10, 2024
1 parent fcdb374 commit f09a2b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_passes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ passes_doc_masked_only_extern_crate =
.not_an_extern_crate_label = not an `extern crate` item
.note = read <https://doc.rust-lang.org/unstable-book/language-features/doc-masked.html> for more information
passes_doc_rust_logo =
the `#[doc(rust_logo)]` attribute is used for Rust branding
passes_doc_test_literal = `#![doc(test(...)]` does not take a literal
passes_doc_test_takes_list =
Expand Down Expand Up @@ -595,6 +598,9 @@ passes_remove_fields =
*[other] fields
}
passes_repr_align_function =
`repr(align)` attributes on functions are unstable
passes_repr_conflicting =
conflicting representation hints
Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
/// of one item. Read the documentation of [`check_doc_inline`] for more information.
///
/// [`check_doc_inline`]: Self::check_doc_inline
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn check_doc_attrs(
&self,
attr: &Attribute,
Expand Down Expand Up @@ -1220,7 +1219,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
&self.tcx.sess,
sym::rustdoc_internals,
meta.span(),
"the `#[doc(rust_logo)]` attribute is used for Rust branding",
fluent::passes_doc_rust_logo,
)
.emit();
}
Expand Down Expand Up @@ -1736,7 +1735,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}

/// Checks if the `#[repr]` attributes on `item` are valid.
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
fn check_repr(
&self,
attrs: &[Attribute],
Expand Down Expand Up @@ -1793,7 +1791,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
&self.tcx.sess,
sym::fn_align,
hint.span(),
"`repr(align)` attributes on functions are unstable",
fluent::passes_repr_align_function,
)
.emit();
}
Expand Down

0 comments on commit f09a2b0

Please sign in to comment.