aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics.rs
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2021-02-20 10:43:52 +0000
committerLaurenČ›iu Nicola <[email protected]>2021-02-20 10:43:52 +0000
commitc1d37f030f01b5227168a822ed61cb27e6c67429 (patch)
tree8b644487b66e8c085747429a46ef5745f39b1cc3 /crates/hir_ty/src/diagnostics.rs
parentaf4148970a800b8df733f961b14403b800d3fb01 (diff)
Add test
Diffstat (limited to 'crates/hir_ty/src/diagnostics.rs')
-rw-r--r--crates/hir_ty/src/diagnostics.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/hir_ty/src/diagnostics.rs b/crates/hir_ty/src/diagnostics.rs
index 19da51acd..6bca7aa0d 100644
--- a/crates/hir_ty/src/diagnostics.rs
+++ b/crates/hir_ty/src/diagnostics.rs
@@ -682,6 +682,30 @@ fn baz(s: S) -> i32 {
682 } 682 }
683 683
684 #[test] 684 #[test]
685 fn missing_record_pat_field_box() {
686 check_diagnostics(
687 r"
688struct S { s: Box<u32> }
689fn 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"
700struct S { s: u32 }
701fn x(a: S) {
702 let S { ref s } = a;
703}
704",
705 )
706 }
707
708 #[test]
685 fn break_outside_of_loop() { 709 fn break_outside_of_loop() {
686 check_diagnostics( 710 check_diagnostics(
687 r#" 711 r#"