Skip to content

Commit

Permalink
Merge pull request #1040 from Nilstrieb/patch-1
Browse files Browse the repository at this point in the history
Update diagnostics migration blog post to use new flat slugs
  • Loading branch information
rylev authored Oct 27, 2022
2 parents d174cb6 + 037718f commit 5885684
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions posts/inside-rust/2022-08-16-diagnostic-effort.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ primary `Span` (that was given to `struct_span_err`).

```rust
#[derive(SessionDiagnostic)]
#[error(parser::return_type_arrow)]
#[error(parser_return_type_arrow)]
struct ReturnTypeArrow {
#[primary_span]
span: Span,
Expand All @@ -177,7 +177,7 @@ Finally, we need to add any labels, notes, helps or suggestions:

```rust
#[derive(SessionDiagnostic)]
#[error(parser::return_type_arrow)]
#[error(parser_return_type_arrow)]
struct ReturnTypeArrow {
#[primary_span]
#[suggestion(applicability = "machine-applicable", code = "->")]
Expand Down Expand Up @@ -212,11 +212,11 @@ impl SessionDiagnostic for ReturnTypeArrow {
fn into_diagnostic(self, sess: &'_ rustc_session::Session) -> DiagnosticBuilder<'_> {
sess.struct_span_err(
self.span,
fluent::parser::return_type_arrow,
fluent::parser_return_type_arrow,
)
.span_suggestion_short(
self.span,
fluent::parser::suggestion,
fluent::suggestion,
"->".to_string(),
Applicability::MachineApplicable,
)
Expand Down

0 comments on commit 5885684

Please sign in to comment.