Allow raw identifiers to be used as fluent arguments
This commit is contained in:
@@ -281,6 +281,8 @@ impl<'a> DiagnosticDeriveVariantBuilder<'a> {
|
||||
if should_generate_set_arg(&field) {
|
||||
let diag = &self.parent.diag;
|
||||
let ident = field.ident.as_ref().unwrap();
|
||||
// strip `r#` prefix, if present
|
||||
let ident = format_ident!("{}", ident);
|
||||
return quote! {
|
||||
#diag.set_arg(
|
||||
stringify!(#ident),
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user