Skip to content

Commit dc90d1d

Browse files
committed
errors: remove diagnostic message ctors
Now that typed identifiers are used in both derives, constructors for the `DiagnosticMessage` and `SubdiagnosticMessage` types are not required. Signed-off-by: David Wood <[email protected]>
1 parent abd3467 commit dc90d1d

File tree

1 file changed

+0
-17
lines changed
  • compiler/rustc_error_messages/src

1 file changed

+0
-17
lines changed

compiler/rustc_error_messages/src/lib.rs

-17
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,6 @@ pub enum SubdiagnosticMessage {
258258
FluentAttr(FluentId),
259259
}
260260

261-
impl SubdiagnosticMessage {
262-
/// Create a `SubdiagnosticMessage` for the provided Fluent attribute.
263-
pub fn attr(id: impl Into<FluentId>) -> Self {
264-
SubdiagnosticMessage::FluentAttr(id.into())
265-
}
266-
267-
/// Create a `SubdiagnosticMessage` for the provided Fluent identifier.
268-
pub fn message(id: impl Into<FluentId>) -> Self {
269-
SubdiagnosticMessage::FluentIdentifier(id.into())
270-
}
271-
}
272-
273261
/// `From` impl that enables existing diagnostic calls to functions which now take
274262
/// `impl Into<SubdiagnosticMessage>` to continue to work as before.
275263
impl<S: Into<String>> From<S> for SubdiagnosticMessage {
@@ -332,11 +320,6 @@ impl DiagnosticMessage {
332320
_ => panic!("expected non-translatable diagnostic message"),
333321
}
334322
}
335-
336-
/// Create a `DiagnosticMessage` for the provided Fluent identifier.
337-
pub fn new(id: impl Into<FluentId>) -> Self {
338-
DiagnosticMessage::FluentIdentifier(id.into(), None)
339-
}
340323
}
341324

342325
/// `From` impl that enables existing diagnostic calls to functions which now take

0 commit comments

Comments
 (0)