Skip to content

Commit b30abb5

Browse files
Rollup merge of #152351 - JonathanBrouwer:remove_subdiag, r=nnethercote
Remove `SubdiagMessage` in favour of the identical `DiagMessage` For rust-lang/rust#151366 Just some more cleanup :) SubdiagMessage is now identical to DiagMessage, so there's no point in having both of them
2 parents 84a468c + 9d2a8c3 commit b30abb5

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/diagnostics/translation.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ translation.
135135
### Messages
136136

137137
All of rustc's traditional diagnostic APIs (e.g. `struct_span_err` or `note`)
138-
take any message that can be converted into a `DiagMessage` (or
139-
`SubdiagMessage`).
138+
take any message that can be converted into a `DiagMessage`.
140139

141140
[`rustc_error_messages::DiagMessage`] can represent legacy non-translatable
142141
diagnostic messages and translatable messages. Non-translatable messages are
@@ -149,14 +148,7 @@ with an attribute).
149148
Fluent resource (described in more detail below), or `DiagMessage`s will
150149
either be created in the macro-generated code of a diagnostic derive.
151150

152-
`rustc_error_messages::SubdiagMessage` is similar, it can correspond to a
153-
legacy non-translatable diagnostic message or the name of an attribute to a
154-
Fluent message. Translatable `SubdiagMessage`s must be combined with a
155-
`DiagMessage` (using `DiagMessage::with_subdiagnostic_message`) to
156-
be emitted (an attribute name on its own is meaningless without a corresponding
157-
message identifier, which is what `DiagMessage` provides).
158-
159-
Both `DiagMessage` and `SubdiagMessage` implement `Into` for any
151+
`DiagMessage` implements `Into` for any
160152
type that can be converted into a string, and converts these into
161153
non-translatable diagnostics - this keeps all existing diagnostic calls
162154
working.

0 commit comments

Comments
 (0)