From 6f54eeb07096645c6b92fc766ffec752c770b594 Mon Sep 17 00:00:00 2001 From: r01and Date: Thu, 29 Feb 2024 23:13:09 +0800 Subject: [PATCH 1/3] Remove unused structs --- src/errors.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 62be9e9b379..6b781f10998 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,10 +1,8 @@ use rustc_errors::{ - DiagCtxt, DiagnosticArgValue, DiagnosticBuilder, EmissionGuarantee, IntoDiagnostic, - IntoDiagnosticArg, Level, + DiagCtxt, DiagnosticBuilder, EmissionGuarantee, IntoDiagnostic, Level, }; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_span::Span; -use std::borrow::Cow; use crate::fluent_generated as fluent; @@ -32,18 +30,6 @@ pub(crate) enum PossibleFeature<'a> { None, } -struct ExitCode(Option); - -impl IntoDiagnosticArg for ExitCode { - fn into_diagnostic_arg(self) -> DiagnosticArgValue { - let ExitCode(exit_code) = self; - match exit_code { - Some(t) => t.into_diagnostic_arg(), - None => DiagnosticArgValue::Str(Cow::Borrowed("")), - } - } -} - #[derive(Diagnostic)] #[diag(codegen_gcc_lto_not_supported)] pub(crate) struct LTONotSupported; @@ -81,12 +67,6 @@ pub(crate) struct CopyBitcode { #[note] pub(crate) struct DynamicLinkingWithLTO; -#[derive(Diagnostic)] -#[diag(codegen_gcc_load_bitcode)] -pub(crate) struct LoadBitcode { - name: String, -} - #[derive(Diagnostic)] #[diag(codegen_gcc_lto_disallowed)] pub(crate) struct LtoDisallowed; From 1b124a9bbd3637d23f1c1a8e41fcb2594a26a077 Mon Sep 17 00:00:00 2001 From: r01and Date: Thu, 29 Feb 2024 23:26:34 +0800 Subject: [PATCH 2/3] Format codes --- src/errors.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 6b781f10998..58d74ca733b 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,6 +1,4 @@ -use rustc_errors::{ - DiagCtxt, DiagnosticBuilder, EmissionGuarantee, IntoDiagnostic, Level, -}; +use rustc_errors::{DiagCtxt, DiagnosticBuilder, EmissionGuarantee, IntoDiagnostic, Level}; use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_span::Span; From 7e4b53e45b71abdc1da2960beeb87765330b6340 Mon Sep 17 00:00:00 2001 From: r01and Date: Fri, 1 Mar 2024 09:50:33 +0800 Subject: [PATCH 3/3] Remove unused fluent messages --- messages.ftl | 2 -- 1 file changed, 2 deletions(-) diff --git a/messages.ftl b/messages.ftl index 5ca0a2e1b6d..0235384445e 100644 --- a/messages.ftl +++ b/messages.ftl @@ -20,8 +20,6 @@ codegen_gcc_dynamic_linking_with_lto = cannot prefer dynamic linking when performing LTO .note = only 'staticlib', 'bin', and 'cdylib' outputs are supported with LTO -codegen_gcc_load_bitcode = failed to load bitcode of module "{$name}" - codegen_gcc_lto_disallowed = lto can only be run for executables, cdylibs and static library outputs codegen_gcc_lto_dylib = lto cannot be used for `dylib` crate type without `-Zdylib-lto`