From e2b664e9fdecebd967d0c7d31e5ad5a07512b7a6 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 7 May 2021 15:35:02 +0200 Subject: fix: use raw idents in `make::name{_ref}` with keywords --- crates/ide/src/diagnostics.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crates/ide') diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index b14f908b7..273d8cfbb 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs @@ -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( -- cgit v1.2.3