aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-07 16:33:08 +0100
committerGitHub <[email protected]>2021-05-07 16:33:08 +0100
commit0bc85ac7986347d50d2eb8403084d61ac33447a4 (patch)
tree2eb25332537713f08117d15ad86210580cd7b00c /crates/ide/src
parenta8da2ca3a189a3f9a422c38d0a26298dc0a9ce6f (diff)
parente2b664e9fdecebd967d0c7d31e5ad5a07512b7a6 (diff)
Merge #8748
8748: fix: use raw idents in `make::{name, name_ref}` when used with a keyword r=jonas-schievink a=jonas-schievink fixes https://github.com/rust-analyzer/rust-analyzer/issues/8680 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/diagnostics.rs20
1 files changed, 20 insertions, 0 deletions
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
@@ -654,6 +654,26 @@ fn test_fn() {
654 } 654 }
655 655
656 #[test] 656 #[test]
657 fn test_fill_struct_fields_raw_ident() {
658 check_fix(
659 r#"
660struct TestStruct { r#type: u8 }
661
662fn test_fn() {
663 TestStruct { $0 };
664}
665"#,
666 r"
667struct TestStruct { r#type: u8 }
668
669fn test_fn() {
670 TestStruct { r#type: () };
671}
672",
673 );
674 }
675
676 #[test]
657 fn test_fill_struct_fields_no_diagnostic() { 677 fn test_fill_struct_fields_no_diagnostic() {
658 check_no_diagnostics( 678 check_no_diagnostics(
659 r" 679 r"