aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-30 20:51:47 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-30 20:51:47 +0000
commit28fdb8d03caf1ab8b40ed0fcbe8e47451fe030d9 (patch)
treea795362bb8cd25edb87e8da3f9786d68e029c22b /crates/ra_hir/src/ty/tests.rs
parentdb17e06c2eec892ab807fd191bc11b15d8da42e2 (diff)
parent13cb4a1b370038dee51ae739a42d6b98acaef385 (diff)
Merge #701
701: Minor type inference tweaks r=flodiebold a=marcusklaas Pass down expectation for reference expressions and type the guard in match expressions. I wasn't able to add a test for the former addition because the type variable previously introduced would always resolve to the right type in the things I tried! Co-authored-by: Marcus Klaas de Vries <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index b36e6ec47..cb8d6351d 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -371,6 +371,7 @@ fn test(x: &str, y: isize) {
371 371
372 let b = [a, ["b"]]; 372 let b = [a, ["b"]];
373 let x: [u8; 0] = []; 373 let x: [u8; 0] = [];
374 let z: &[u8] = &[1, 2, 3];
374} 375}
375"#, 376"#,
376 ); 377 );
@@ -426,7 +427,8 @@ fn test() {
426 427
427 match e { 428 match e {
428 E::A { x } => x, 429 E::A { x } => x,
429 E::B => 1, 430 E::B if foo => 1,
431 E::B => 10,
430 }; 432 };
431 433
432 let ref d @ E::A { .. } = e; 434 let ref d @ E::A { .. } = e;