@@ -17,13 +17,13 @@ shown below:
1717
1818``` rust,ignore
1919#[derive(Diagnostic)]
20- #[diag(hir_analysis::field_already_declared , code = "E0124")]
20+ #[diag(hir_analysis_field_already_declared , code = "E0124")]
2121pub struct FieldAlreadyDeclared {
2222 pub field_name: Ident,
2323 #[primary_span]
2424 #[label]
2525 pub span: Span,
26- #[label(hir_analysis::previous_decl_label )]
26+ #[label(hir_analysis_previous_decl_label )]
2727 pub prev_span: Span,
2828}
2929```
@@ -113,15 +113,15 @@ In the end, the `Diagnostic` derive will generate an implementation of
113113``` rust,ignore
114114impl IntoDiagnostic<'_> for FieldAlreadyDeclared {
115115 fn into_diagnostic(self, handler: &'_ rustc_errors::Handler) -> DiagnosticBuilder<'_> {
116- let mut diag = handler.struct_err(rustc_errors::fluent::hir_analysis::field_already_declared );
116+ let mut diag = handler.struct_err(rustc_errors::fluent::hir_analysis_field_already_declared );
117117 diag.set_span(self.span);
118118 diag.span_label(
119119 self.span,
120- rustc_errors::fluent::hir_analysis::label
120+ rustc_errors::fluent::hir_analysis_label
121121 );
122122 diag.span_label(
123123 self.prev_span,
124- rustc_errors::fluent::hir_analysis::previous_decl_label
124+ rustc_errors::fluent::hir_analysis_previous_decl_label
125125 );
126126 diag
127127 }
@@ -151,12 +151,10 @@ following attributes:
151151 - Slug (_ Mandatory_ )
152152 - Uniquely identifies the diagnostic and corresponds to its Fluent message,
153153 mandatory.
154- - A path to an item in ` rustc_errors::fluent ` . Always in a module starting
155- with a Fluent resource name (which is typically the name of the crate
156- that the diagnostic is from), e.g.
157- ` rustc_errors::fluent::hir_analysis::field_already_declared `
154+ - A path to an item in ` rustc_errors::fluent ` , e.g.
155+ ` rustc_errors::fluent::hir_analysis_field_already_declared `
158156 (` rustc_errors::fluent ` is implicit in the attribute, so just
159- ` hir_analysis::field_already_declared ` ).
157+ ` hir_analysis_field_already_declared ` ).
160158 - See [ translation documentation] ( ./translation.md ) .
161159 - ` code = "..." ` (_ Optional_ )
162160 - Specifies the error code.
@@ -191,14 +189,12 @@ following attributes:
191189 - _ Applied to ` (Span, MachineApplicability) ` or ` Span ` fields._
192190 - Adds a suggestion subdiagnostic.
193191 - Slug (_ Mandatory_ )
194- - A path to an item in ` rustc_errors::fluent ` . Always in a module starting
195- with a Fluent resource name (which is typically the name of the crate
196- that the diagnostic is from), e.g.
197- ` rustc_errors::fluent::hir_analysis::field_already_declared `
192+ - A path to an item in ` rustc_errors::fluent ` , e.g.
193+ ` rustc_errors::fluent::hir_analysis_field_already_declared `
198194 (` rustc_errors::fluent ` is implicit in the attribute, so just
199- ` hir_analysis::field_already_declared ` ). Fluent attributes for all messages
195+ ` hir_analysis_field_already_declared ` ). Fluent attributes for all messages
200196 exist as top-level items in that module (so ` hir_analysis_message.attr ` is just
201- ` hir_analysis:: attr` ).
197+ ` attr ` ).
202198 - See [ translation documentation] ( ./translation.md ) .
203199 - Defaults to ` rustc_errors::fluent::_subdiag::suggestion ` (or
204200 - ` .suggestion ` in Fluent).
@@ -233,12 +229,12 @@ shown below:
233229``` rust
234230#[derive(Subdiagnostic )]
235231pub enum ExpectedReturnTypeLabel <'tcx > {
236- #[label(hir_analysis :: expected_default_return_type )]
232+ #[label(hir_analysis_expected_default_return_type )]
237233 Unit {
238234 #[primary_span]
239235 span : Span ,
240236 },
241- #[label(hir_analysis :: expected_return_type )]
237+ #[label(hir_analysis_expected_return_type )]
242238 Other {
243239 #[primary_span]
244240 span : Span ,
@@ -315,11 +311,11 @@ impl<'tcx> AddToDiagnostic for ExpectedReturnTypeLabel<'tcx> {
315311 use rustc_errors :: {Applicability , IntoDiagnosticArg };
316312 match self {
317313 ExpectedReturnTypeLabel :: Unit { span } => {
318- diag . span_label (span , rustc_errors :: fluent :: hir_analysis :: expected_default_return_type )
314+ diag . span_label (span , rustc_errors :: fluent :: hir_analysis_expected_default_return_type )
319315 }
320316 ExpectedReturnTypeLabel :: Other { span , expected } => {
321317 diag . set_arg (" expected" , expected );
322- diag . span_label (span , rustc_errors :: fluent :: hir_analysis :: expected_return_type )
318+ diag . span_label (span , rustc_errors :: fluent :: hir_analysis_expected_return_type )
323319 }
324320
325321 }
@@ -342,22 +338,18 @@ diagnostic struct.
342338 - Slug (_ Mandatory_ )
343339 - Uniquely identifies the diagnostic and corresponds to its Fluent message,
344340 mandatory.
345- - A path to an item in ` rustc_errors::fluent ` . Always in a module starting
346- with a Fluent resource name (which is typically the name of the crate
347- that the diagnostic is from), e.g.
348- ` rustc_errors::fluent::hir_analysis::field_already_declared `
341+ - A path to an item in ` rustc_errors::fluent ` , e.g.
342+ ` rustc_errors::fluent::hir_analysis_field_already_declared `
349343 (` rustc_errors::fluent ` is implicit in the attribute, so just
350- ` hir_analysis::field_already_declared ` ).
344+ ` hir_analysis_field_already_declared ` ).
351345 - See [ translation documentation] ( ./translation.md ) .
352346- ` #[suggestion{,_hidden,_short,_verbose}(slug, code = "...", applicability = "...")] `
353347 - _ Applied to struct or enum variant. Mutually exclusive with struct/enum variant attributes._
354348 - _ Mandatory_
355349 - Defines the type to be representing a suggestion.
356350 - Slug (_ Mandatory_ )
357- - A path to an item in ` rustc_errors::fluent ` . Always in a module starting
358- with a Fluent resource name (which is typically the name of the crate
359- that the diagnostic is from), e.g.
360- ` rustc_errors::fluent::hir_analysis::field_already_declared `
351+ - A path to an item in ` rustc_errors::fluent ` , e.g.
352+ ` rustc_errors::fluent::hir_analysis_field_already_declared `
361353 (` rustc_errors::fluent ` is implicit in the attribute, so just
362354 ` hir_analysis::field_already_declared ` ). Fluent attributes for all messages
363355 exist as top-level items in that module (so ` hir_analysis_message.attr ` is just
0 commit comments