Skip to content

Commit c1d37f0

Browse files
committed
Add test
1 parent af41489 commit c1d37f0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

crates/hir_ty/src/diagnostics.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,30 @@ fn baz(s: S) -> i32 {
681681
)
682682
}
683683

684+
#[test]
685+
fn missing_record_pat_field_box() {
686+
check_diagnostics(
687+
r"
688+
struct S { s: Box<u32> }
689+
fn x(a: S) {
690+
let S { box s } = a;
691+
}
692+
",
693+
)
694+
}
695+
696+
#[test]
697+
fn missing_record_pat_field_ref() {
698+
check_diagnostics(
699+
r"
700+
struct S { s: u32 }
701+
fn x(a: S) {
702+
let S { ref s } = a;
703+
}
704+
",
705+
)
706+
}
707+
684708
#[test]
685709
fn break_outside_of_loop() {
686710
check_diagnostics(

0 commit comments

Comments
 (0)