]> git.lizzy.rs Git - rust.git/commitdiff
lint and remove unused diagnostic
authorEllis Hoag <ellis.sparky.hoag@gmail.com>
Tue, 27 Sep 2022 02:57:40 +0000 (19:57 -0700)
committerEllis Hoag <ellis.sparky.hoag@gmail.com>
Tue, 27 Sep 2022 02:57:40 +0000 (19:57 -0700)
compiler/rustc_codegen_gcc/src/errors.rs
compiler/rustc_error_messages/locales/en-US/codegen_gcc.ftl

index eb8528104fac316913c4e097b9fea736eb3f7b5f..83f4af16612e7ae95d9f3b15e8a0c5852dc3dfbf 100644 (file)
@@ -4,13 +4,12 @@
 use rustc_span::{Span, Symbol};
 use std::borrow::Cow;
 
-struct ExitCode {
-    pub exit_code: Option<i32>,
-}
+struct ExitCode(Option<i32>);
 
 impl IntoDiagnosticArg for ExitCode {
     fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
-        match self.exit_code {
+        let ExitCode(exit_code) = self;
+        match exit_code {
             Some(t) => t.into_diagnostic_arg(),
             None => DiagnosticArgValue::Str(Cow::Borrowed("None")),
         }
@@ -25,8 +24,7 @@ pub(crate) struct RanlibFailure {
 
 impl RanlibFailure {
     pub fn new(exit_code: Option<i32>) -> Self {
-        let exit_code = ExitCode{ exit_code };
-        RanlibFailure { exit_code }
+        RanlibFailure { exit_code: ExitCode(exit_code) }
     }
 }
 
index 2497d550323967431c6f6868d61c9173b6d27181..178e1a67ccecff46fb28b1bfc715ec1cd0287fbf 100644 (file)
@@ -1,9 +1,6 @@
 codegen_gcc_ranlib_failure =
     Ranlib exited with code {$exit_code}
 
-codegen_gcc_layout_size_overflow =
-    {$error}
-
 codegen_gcc_linkage_const_or_mut_type =
     must have type `*const T` or `*mut T` due to `#[linkage]` attribute