diff options
| author | Ellis Hoag <ellis.sparky.hoag@gmail.com> | 2022-09-26 19:57:40 -0700 |
|---|---|---|
| committer | Ellis Hoag <ellis.sparky.hoag@gmail.com> | 2022-09-26 19:57:40 -0700 |
| commit | 6d01c6d9c8851ddfa8d520c03e9ac93ef7f82ce3 (patch) | |
| tree | 65bc1f5ac05ebb0d84424f0868a3cf5a495c5b1b /compiler/rustc_codegen_gcc | |
| parent | d7bee58105e01b0e259bf6b0cb1b90c841ba00e0 (diff) | |
| download | rust-6d01c6d9c8851ddfa8d520c03e9ac93ef7f82ce3.tar.gz rust-6d01c6d9c8851ddfa8d520c03e9ac93ef7f82ce3.zip | |
lint and remove unused diagnostic
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/errors.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_gcc/src/errors.rs b/compiler/rustc_codegen_gcc/src/errors.rs index eb8528104fa..83f4af16612 100644 --- a/compiler/rustc_codegen_gcc/src/errors.rs +++ b/compiler/rustc_codegen_gcc/src/errors.rs @@ -4,13 +4,12 @@ use rustc_middle::ty::Ty; 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) } } } |
