about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2022-03-23 07:34:20 +0000
committerDavid Wood <david.wood@huawei.com>2022-04-05 06:53:39 +0100
commit8c684563a59900d96a4fcadd41e5e92074c13df1 (patch)
tree6ca30a8bac58d182007db189d32231d159013071 /compiler/rustc_codegen_ssa
parenta22cf2af0510b3ec4cbb19c3de11d3d8291349d9 (diff)
downloadrust-8c684563a59900d96a4fcadd41e5e92074c13df1.tar.gz
rust-8c684563a59900d96a4fcadd41e5e92074c13df1.zip
errors: introduce `DiagnosticMessage`
Introduce a `DiagnosticMessage` type that will enable diagnostic
messages to be simple strings or Fluent identifiers.
`DiagnosticMessage` is now used in the implementation of the standard
`DiagnosticBuilder` APIs.

Signed-off-by: David Wood <david.wood@huawei.com>
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/write.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs
index 9417874ffb4..8aa18b8e37c 100644
--- a/compiler/rustc_codegen_ssa/src/back/write.rs
+++ b/compiler/rustc_codegen_ssa/src/back/write.rs
@@ -1708,13 +1708,13 @@ impl SharedEmitter {
 impl Emitter for SharedEmitter {
     fn emit_diagnostic(&mut self, diag: &rustc_errors::Diagnostic) {
         drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
-            msg: diag.message(),
+            msg: diag.message().to_string(),
             code: diag.code.clone(),
             lvl: diag.level(),
         })));
         for child in &diag.children {
             drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
-                msg: child.message(),
+                msg: child.message().to_string(),
                 code: None,
                 lvl: child.level,
             })));