diff options
| author | HTGAzureX1212. <39023054+HTGAzureX1212@users.noreply.github.com> | 2024-01-23 10:56:33 +0800 |
|---|---|---|
| committer | HTGAzureX1212. <39023054+HTGAzureX1212@users.noreply.github.com> | 2024-01-23 10:56:33 +0800 |
| commit | f3682a1304200d554d2d36abf21376861b9ae14a (patch) | |
| tree | ad6e22bb62d103decfa360c086efcba6854cfc63 /compiler/rustc_errors | |
| parent | 0011fac90d2846ea3c04506238ff6e4ed3ce0efe (diff) | |
| download | rust-f3682a1304200d554d2d36abf21376861b9ae14a.tar.gz rust-f3682a1304200d554d2d36abf21376861b9ae14a.zip | |
add list of characters to uncommon codepoints lint
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_impls.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index 39252dea283..f6679ae9bb3 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -110,6 +110,14 @@ impl IntoDiagnosticArg for char { } } +impl IntoDiagnosticArg for Vec<char> { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + DiagnosticArgValue::StrListSepByAnd( + self.into_iter().map(|c| Cow::Owned(format!("{c:?}"))).collect(), + ) + } +} + impl IntoDiagnosticArg for Symbol { fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { self.to_ident_string().into_diagnostic_arg() |
