diff options
| author | David Wood <david.wood@huawei.com> | 2022-06-23 16:14:48 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2022-06-24 09:08:25 +0100 |
| commit | dc90d1d987d74af4950caca0f9b16d7fdf21b6af (patch) | |
| tree | 4c5610240f5ff1692fa529fbf413cc5ae9ed739d | |
| parent | abd3467d47ad8f366239100334c31478f075a0de (diff) | |
| download | rust-dc90d1d987d74af4950caca0f9b16d7fdf21b6af.tar.gz rust-dc90d1d987d74af4950caca0f9b16d7fdf21b6af.zip | |
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 <david.wood@huawei.com>
| -rw-r--r-- | compiler/rustc_error_messages/src/lib.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs index 8d5ab1a4517..673e160cc1e 100644 --- a/compiler/rustc_error_messages/src/lib.rs +++ b/compiler/rustc_error_messages/src/lib.rs @@ -258,18 +258,6 @@ pub enum SubdiagnosticMessage { FluentAttr(FluentId), } -impl SubdiagnosticMessage { - /// Create a `SubdiagnosticMessage` for the provided Fluent attribute. - pub fn attr(id: impl Into<FluentId>) -> Self { - SubdiagnosticMessage::FluentAttr(id.into()) - } - - /// Create a `SubdiagnosticMessage` for the provided Fluent identifier. - pub fn message(id: impl Into<FluentId>) -> Self { - SubdiagnosticMessage::FluentIdentifier(id.into()) - } -} - /// `From` impl that enables existing diagnostic calls to functions which now take /// `impl Into<SubdiagnosticMessage>` to continue to work as before. impl<S: Into<String>> From<S> for SubdiagnosticMessage { @@ -332,11 +320,6 @@ impl DiagnosticMessage { _ => panic!("expected non-translatable diagnostic message"), } } - - /// Create a `DiagnosticMessage` for the provided Fluent identifier. - pub fn new(id: impl Into<FluentId>) -> Self { - DiagnosticMessage::FluentIdentifier(id.into(), None) - } } /// `From` impl that enables existing diagnostic calls to functions which now take |
