aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/tests.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index a430cbe88..fc1e5b09c 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -358,6 +358,21 @@ fn test(x: &str, y: isize) {
358 ); 358 );
359} 359}
360 360
361#[test]
362fn infer_pattern() {
363 check_inference(
364 r#"
365fn test(x: &i32) {
366 let y = x;
367 let &z = x;
368 let a = z;
369 let (c, d) = (1, "hello");
370}
371"#,
372 "pattern.txt",
373 );
374}
375
361fn infer(content: &str) -> String { 376fn infer(content: &str) -> String {
362 let (db, _, file_id) = MockDatabase::with_single_file(content); 377 let (db, _, file_id) = MockDatabase::with_single_file(content);
363 let source_file = db.source_file(file_id); 378 let source_file = db.source_file(file_id);