diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-09-03 10:33:05 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-03 10:33:05 +0530 |
| commit | a0056795da7a51f0ebebf0d5ad8f0b663d089420 (patch) | |
| tree | fcbeee4805d8b23bdbbe9b39425d28a45446ff2a /compiler/rustc_errors/src | |
| parent | 2ed716a81d36c0779bb132031fc9ef0b9e7f4212 (diff) | |
| parent | 30adfd6a17bd0d7c4d1302cc4a0f92962577de4a (diff) | |
| download | rust-a0056795da7a51f0ebebf0d5ad8f0b663d089420.tar.gz rust-a0056795da7a51f0ebebf0d5ad8f0b663d089420.zip | |
Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwco
Migrate rustc_metadata to SessionDiagnostics Migrate rustc_metadata to SessionDiagnostics. Part of https://github.com/rust-lang/rust/issues/100717
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index 95ae9765a48..a052aaee047 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -10,6 +10,7 @@ use rustc_lint_defs::{Applicability, LintExpectationId}; use rustc_span::edition::LATEST_STABLE_EDITION; use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol}; use rustc_span::{edition::Edition, Span, DUMMY_SP}; +use rustc_target::spec::PanicStrategy; use std::borrow::Cow; use std::fmt; use std::hash::{Hash, Hasher}; @@ -144,6 +145,12 @@ impl IntoDiagnosticArg for usize { } } +impl IntoDiagnosticArg for PanicStrategy { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + DiagnosticArgValue::Str(Cow::Owned(self.desc().to_string())) + } +} + impl<'source> Into<FluentValue<'source>> for DiagnosticArgValue<'source> { fn into(self) -> FluentValue<'source> { match self { |
