Skip to content

Commit b66f4bb

Browse files
committed
minor
1 parent de1fc70 commit b66f4bb

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

crates/ide/src/diagnostics.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -671,44 +671,6 @@ mod foo;
671671
);
672672
}
673673

674-
#[test]
675-
fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() {
676-
check_diagnostics(
677-
r"
678-
struct S { foo: i32, bar: () }
679-
fn 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"
692-
struct S { s: Box<u32> }
693-
fn 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"
704-
struct S { s: u32 }
705-
fn x(a: S) {
706-
let S { ref s } = a;
707-
}
708-
",
709-
)
710-
}
711-
712674
#[test]
713675
fn import_extern_crate_clash_with_inner_item() {
714676
// This is more of a resolver test, but doesn't really work with the hir_def testsuite.

crates/ide/src/diagnostics/missing_fields.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,44 @@ fn baz(s: S) {
9393
);
9494
}
9595

96+
#[test]
97+
fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() {
98+
check_diagnostics(
99+
r"
100+
struct S { foo: i32, bar: () }
101+
fn 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"
114+
struct S { s: Box<u32> }
115+
fn 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"
126+
struct S { s: u32 }
127+
fn x(a: S) {
128+
let S { ref s } = a;
129+
}
130+
",
131+
)
132+
}
133+
96134
#[test]
97135
fn range_mapping_out_of_macros() {
98136
// FIXME: this is very wrong, but somewhat tricky to fix.

0 commit comments

Comments
 (0)