diff options
| author | nils <48135649+Nilstrieb@users.noreply.github.com> | 2022-11-15 14:24:33 +0100 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2022-12-10 11:02:41 +0100 |
| commit | 2f9f097cb8b6c27a7e0d7a916e6911fc1f5ecd81 (patch) | |
| tree | 3f5b890f89761f43f7d3071718491dcf72c4d285 /compiler/rustc_errors/src | |
| parent | a000811405e6a3ca9b0b129c1177e78564e09666 (diff) | |
| download | rust-2f9f097cb8b6c27a7e0d7a916e6911fc1f5ecd81.tar.gz rust-2f9f097cb8b6c27a7e0d7a916e6911fc1f5ecd81.zip | |
Migrate parts of `rustc_expand` to session diagnostics
This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/diagnostic_impls.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/diagnostic_impls.rs b/compiler/rustc_errors/src/diagnostic_impls.rs index 7155db32e53..cb39e997436 100644 --- a/compiler/rustc_errors/src/diagnostic_impls.rs +++ b/compiler/rustc_errors/src/diagnostic_impls.rs @@ -152,6 +152,12 @@ impl IntoDiagnosticArg for ast::Path { } } +impl IntoDiagnosticArg for &ast::Path { + fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { + DiagnosticArgValue::Str(Cow::Owned(pprust::path_to_string(self))) + } +} + impl IntoDiagnosticArg for ast::token::Token { fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> { DiagnosticArgValue::Str(pprust::token_to_string(&self)) |
