fix: use raw idents in make::name{_ref} with keywords

This commit is contained in:
Jonas Schievink 2021-05-07 15:35:02 +02:00
parent a8da2ca3a1
commit e2b664e9fd
2 changed files with 32 additions and 2 deletions

View file

@ -653,6 +653,26 @@ fn test_fn() {
);
}
#[test]
fn test_fill_struct_fields_raw_ident() {
check_fix(
r#"
struct TestStruct { r#type: u8 }
fn test_fn() {
TestStruct { $0 };
}
"#,
r"
struct TestStruct { r#type: u8 }
fn test_fn() {
TestStruct { r#type: () };
}
",
);
}
#[test]
fn test_fill_struct_fields_no_diagnostic() {
check_no_diagnostics(