aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorMarcus Klaas de Vries <[email protected]>2019-01-15 14:24:04 +0000
committerAleksey Kladov <[email protected]>2019-01-19 12:37:25 +0000
commitafaa26636e4391ebacfc09e9c994c11bab58b834 (patch)
tree79d66f1d2eb70f3092285ab37f1e21c3832ea8b8 /crates/ra_hir/src/ty
parent0a82d9cdc975da27e78839e1a8cb873ba99ae64b (diff)
Add additional pattern variants
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);