Skip to content

Commit e4e725a

Browse files
committed
Convert to inline diagnostics in all codegen backends
1 parent b7728f0 commit e4e725a

3 files changed

Lines changed: 4 additions & 19 deletions

File tree

messages.ftl

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@ use rustc_macros::Diagnostic;
22
use rustc_span::Span;
33

44
#[derive(Diagnostic)]
5-
#[diag(codegen_gcc_unwinding_inline_asm)]
5+
#[diag("GCC backend does not support unwinding from inline asm")]
66
pub(crate) struct UnwindingInlineAsm {
77
#[primary_span]
88
pub span: Span,
99
}
1010

1111
#[derive(Diagnostic)]
12-
#[diag(codegen_gcc_copy_bitcode)]
12+
#[diag("failed to copy bitcode to object file: {$err}")]
1313
pub(crate) struct CopyBitcode {
1414
pub err: std::io::Error,
1515
}
1616

1717
#[derive(Diagnostic)]
18-
#[diag(codegen_gcc_lto_bitcode_from_rlib)]
18+
#[diag("failed to get bitcode from object file for LTO ({$gcc_err})")]
1919
pub(crate) struct LtoBitcodeFromRlib {
2020
pub gcc_err: String,
2121
}
2222

2323
#[derive(Diagnostic)]
24-
#[diag(codegen_gcc_explicit_tail_calls_unsupported)]
24+
#[diag("explicit tail calls with the 'become' keyword are not implemented in the GCC backend")]
2525
pub(crate) struct ExplicitTailCallsUnsupported;

src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ extern crate rustc_ast;
2727
extern crate rustc_codegen_ssa;
2828
extern crate rustc_data_structures;
2929
extern crate rustc_errors;
30-
extern crate rustc_fluent_macro;
3130
extern crate rustc_fs_util;
3231
extern crate rustc_hir;
3332
extern crate rustc_index;
@@ -105,8 +104,6 @@ use tempfile::TempDir;
105104
use crate::back::lto::ModuleBuffer;
106105
use crate::gcc_util::{target_cpu, to_gcc_features};
107106

108-
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
109-
110107
pub struct PrintOnPanic<F: Fn() -> String>(pub F);
111108

112109
impl<F: Fn() -> String> Drop for PrintOnPanic<F> {
@@ -197,10 +194,6 @@ fn load_libgccjit_if_needed(libgccjit_target_lib_file: &Path) {
197194
}
198195

199196
impl CodegenBackend for GccCodegenBackend {
200-
fn locale_resource(&self) -> &'static str {
201-
crate::DEFAULT_LOCALE_RESOURCE
202-
}
203-
204197
fn name(&self) -> &'static str {
205198
"gcc"
206199
}

0 commit comments

Comments
 (0)