This commit is contained in:
Aleksey Kladov 2021-06-13 20:33:59 +03:00
parent de1fc70ccd
commit b66f4bb8d1
2 changed files with 38 additions and 38 deletions

View File

@ -671,44 +671,6 @@ mod foo;
);
}
#[test]
fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() {
check_diagnostics(
r"
struct S { foo: i32, bar: () }
fn baz(s: S) -> i32 {
match s {
S { foo, .. } => foo,
}
}
",
)
}
#[test]
fn missing_record_pat_field_box() {
check_diagnostics(
r"
struct S { s: Box<u32> }
fn x(a: S) {
let S { box s } = a;
}
",
)
}
#[test]
fn missing_record_pat_field_ref() {
check_diagnostics(
r"
struct S { s: u32 }
fn x(a: S) {
let S { ref s } = a;
}
",
)
}
#[test]
fn import_extern_crate_clash_with_inner_item() {
// This is more of a resolver test, but doesn't really work with the hir_def testsuite.

View File

@ -93,6 +93,44 @@ fn baz(s: S) {
);
}
#[test]
fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() {
check_diagnostics(
r"
struct S { foo: i32, bar: () }
fn baz(s: S) -> i32 {
match s {
S { foo, .. } => foo,
}
}
",
)
}
#[test]
fn missing_record_pat_field_box() {
check_diagnostics(
r"
struct S { s: Box<u32> }
fn x(a: S) {
let S { box s } = a;
}
",
)
}
#[test]
fn missing_record_pat_field_ref() {
check_diagnostics(
r"
struct S { s: u32 }
fn x(a: S) {
let S { ref s } = a;
}
",
)
}
#[test]
fn range_mapping_out_of_macros() {
// FIXME: this is very wrong, but somewhat tricky to fix.