mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
minor
This commit is contained in:
parent
de1fc70ccd
commit
b66f4bb8d1
2 changed files with 38 additions and 38 deletions
|
@ -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]
|
#[test]
|
||||||
fn import_extern_crate_clash_with_inner_item() {
|
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.
|
// 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]
|
#[test]
|
||||||
fn range_mapping_out_of_macros() {
|
fn range_mapping_out_of_macros() {
|
||||||
// FIXME: this is very wrong, but somewhat tricky to fix.
|
// FIXME: this is very wrong, but somewhat tricky to fix.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue