diff options
| author | Ellis Hoag <ellis.sparky.hoag@gmail.com> | 2022-08-26 19:32:04 -0700 |
|---|---|---|
| committer | Ellis Hoag <ellis.sparky.hoag@gmail.com> | 2022-09-24 10:24:48 -0700 |
| commit | 9363f0fda5a699b48ea87ad7007dcb811e04a60d (patch) | |
| tree | 5705a78ecadbcbe6296406db166fdc7603ba8ae3 /compiler/rustc_errors/src | |
| parent | 6580010551063718462f9dfe41c9490d92994d0e (diff) | |
| download | rust-9363f0fda5a699b48ea87ad7007dcb811e04a60d.tar.gz rust-9363f0fda5a699b48ea87ad7007dcb811e04a60d.zip | |
Add RanlibFailure
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 1c440a0a07e..f6af0f879ca 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -114,6 +114,15 @@ impl IntoDiagnosticArg for char { } } +impl<T: IntoDiagnosticArg> IntoDiagnosticArg for Option<T> { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + match self { + Some(t) => t.into_diagnostic_arg(), + None => DiagnosticArgValue::Str(Cow::Borrowed("None")), + } + } +} + impl IntoDiagnosticArg for Symbol { fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { self.to_ident_string().into_diagnostic_arg() |
