Closed
Description
I tried this code:
#[derive(SessionDiagnostic)]
#[error(parser::if_expression_missing_condition)]
pub(crate) struct IfExpressionMissingCondition {
#[primary_span]
#[label = "condition_label"]
pub if_span: Span,
#[label = "block_label"]
pub block_span: Span,
}
I expected to see this happen: As explained in the current rustc-dev-guide, the error message is fetched from parser_if_expression_missing_condition
, and the attributes .condition_label
and .block_label
of this fluent resource are used to create two note subdiagnostics.
Instead, this happened:
error: `#[label = ...]` is not a valid attribute
--> compiler/rustc_parse/src/parser/diagnostics.rs:568:5
|
568 | #[label = "condition_label"]
| ^
Working off current rustc master, 9c20b2a.
cc @davidtwco