diff options
| author | Xiretza <xiretza@xiretza.xyz> | 2022-09-14 20:12:22 +0200 |
|---|---|---|
| committer | Xiretza <xiretza@xiretza.xyz> | 2022-09-27 20:29:18 +0200 |
| commit | 4d02892acfdb43490db815010d718bd324f853ad (patch) | |
| tree | 3fa634e75b6bfefb1492fb49f33aa6f1f50967cf /compiler/rustc_macros/src/diagnostics/subdiagnostic.rs | |
| parent | 8489a67f0b0ca5a973d48b27d609c91cb93cf343 (diff) | |
| download | rust-4d02892acfdb43490db815010d718bd324f853ad.tar.gz rust-4d02892acfdb43490db815010d718bd324f853ad.zip | |
Allow raw identifiers to be used as fluent arguments
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/subdiagnostic.rs')
| -rw-r--r-- | compiler/rustc_macros/src/diagnostics/subdiagnostic.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs index adb4902ebc1..9a2588513f0 100644 --- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs @@ -189,6 +189,9 @@ impl<'a> SubdiagnosticDeriveBuilder<'a> { let diag = &self.diag; let ident = ast.ident.as_ref().unwrap(); + // strip `r#` prefix, if present + let ident = format_ident!("{}", ident); + quote! { #diag.set_arg( stringify!(#ident), |
