mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 12:43:36 +00:00
minor
This commit is contained in:
parent
de1fc70ccd
commit
b66f4bb8d1
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user