aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-06-13 18:33:59 +0100
committerAleksey Kladov <[email protected]>2021-06-13 18:33:59 +0100
commitb66f4bb8d1748b83a6f4c5edc3c77a46b213e1c2 (patch)
treeeb34ec6e46f8a15b015e62dc404773a938e45819 /crates
parentde1fc70ccd3bf7a0850e036a12cf866a80d46458 (diff)
minor
Diffstat (limited to 'crates')
-rw-r--r--crates/ide/src/diagnostics.rs38
-rw-r--r--crates/ide/src/diagnostics/missing_fields.rs38
2 files changed, 38 insertions, 38 deletions
diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs
index ec5318594..814e64ae4 100644
--- a/crates/ide/src/diagnostics.rs
+++ b/crates/ide/src/diagnostics.rs
@@ -672,44 +672,6 @@ mod foo;
672 } 672 }
673 673
674 #[test] 674 #[test]
675 fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() {
676 check_diagnostics(
677 r"
678struct S { foo: i32, bar: () }
679fn baz(s: S) -> i32 {
680 match s {
681 S { foo, .. } => foo,
682 }
683}
684",
685 )
686 }
687
688 #[test]
689 fn missing_record_pat_field_box() {
690 check_diagnostics(
691 r"
692struct S { s: Box<u32> }
693fn x(a: S) {
694 let S { box s } = a;
695}
696",
697 )
698 }
699
700 #[test]
701 fn missing_record_pat_field_ref() {
702 check_diagnostics(
703 r"
704struct S { s: u32 }
705fn x(a: S) {
706 let S { ref s } = a;
707}
708",
709 )
710 }
711
712 #[test]
713 fn import_extern_crate_clash_with_inner_item() { 675 fn import_extern_crate_clash_with_inner_item() {
714 // This is more of a resolver test, but doesn't really work with the hir_def testsuite. 676 // This is more of a resolver test, but doesn't really work with the hir_def testsuite.
715 677
diff --git a/crates/ide/src/diagnostics/missing_fields.rs b/crates/ide/src/diagnostics/missing_fields.rs
index c4b6a3679..d01f05041 100644
--- a/crates/ide/src/diagnostics/missing_fields.rs
+++ b/crates/ide/src/diagnostics/missing_fields.rs
@@ -94,6 +94,44 @@ fn baz(s: S) {
94 } 94 }
95 95
96 #[test] 96 #[test]
97 fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() {
98 check_diagnostics(
99 r"
100struct S { foo: i32, bar: () }
101fn baz(s: S) -> i32 {
102 match s {
103 S { foo, .. } => foo,
104 }
105}
106",
107 )
108 }
109
110 #[test]
111 fn missing_record_pat_field_box() {
112 check_diagnostics(
113 r"
114struct S { s: Box<u32> }
115fn x(a: S) {
116 let S { box s } = a;
117}
118",
119 )
120 }
121
122 #[test]
123 fn missing_record_pat_field_ref() {
124 check_diagnostics(
125 r"
126struct S { s: u32 }
127fn x(a: S) {
128 let S { ref s } = a;
129}
130",
131 )
132 }
133
134 #[test]
97 fn range_mapping_out_of_macros() { 135 fn range_mapping_out_of_macros() {
98 // FIXME: this is very wrong, but somewhat tricky to fix. 136 // FIXME: this is very wrong, but somewhat tricky to fix.
99 check_fix( 137 check_fix(