Merge pull request #2872 from aaudiber/raw-ident-struct-expr
Support raw identifiers in struct expressions
This commit is contained in:
commit
dc209cc97f
2 changed files with 2 additions and 2 deletions
|
@ -1651,7 +1651,7 @@ pub fn rewrite_field(
|
||||||
if !attrs_str.is_empty() {
|
if !attrs_str.is_empty() {
|
||||||
attrs_str.push_str(&shape.indent.to_string_with_newline(context.config));
|
attrs_str.push_str(&shape.indent.to_string_with_newline(context.config));
|
||||||
};
|
};
|
||||||
let name = &field.ident.name.to_string();
|
let name = context.snippet(field.ident.span);
|
||||||
if field.is_shorthand {
|
if field.is_shorthand {
|
||||||
Some(attrs_str + &name)
|
Some(attrs_str + &name)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -10,7 +10,7 @@ fn main() {
|
||||||
#[r#attr]
|
#[r#attr]
|
||||||
r#foo::r#bar();
|
r#foo::r#bar();
|
||||||
|
|
||||||
let r#local = 3;
|
let r#local = r#Struct { r#field: () };
|
||||||
let r#async = r#foo(r#local);
|
let r#async = r#foo(r#local);
|
||||||
r#macro!();
|
r#macro!();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue