aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests/coercion.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-20 17:29:11 +0000
committerGitHub <[email protected]>2019-12-20 17:29:11 +0000
commit1d7931e5ffeb2d65ebcc14a63da1b84cc131bfb8 (patch)
tree2b96a667cd1d7bee5ec41abe38d777bc181b674d /crates/ra_hir_ty/src/tests/coercion.rs
parent99d6f544f2a590d3feef47ce62d5cd9a8b463a47 (diff)
parent9c3f00a90651998c2cd4151f43f17cd92ef8eef1 (diff)
Merge #2618
2618: Fix coercion of last expression in function body r=flodiebold a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests/coercion.rs')
-rw-r--r--crates/ra_hir_ty/src/tests/coercion.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/coercion.rs b/crates/ra_hir_ty/src/tests/coercion.rs
index 33d6ca403..793c23e41 100644
--- a/crates/ra_hir_ty/src/tests/coercion.rs
+++ b/crates/ra_hir_ty/src/tests/coercion.rs
@@ -370,6 +370,22 @@ fn test() {
370} 370}
371 371
372#[test] 372#[test]
373fn return_coerce_unknown() {
374 assert_snapshot!(
375 infer_with_mismatches(r#"
376fn foo() -> u32 {
377 return unknown;
378}
379"#, true),
380 @r###"
381 [17; 40) '{ ...own; }': !
382 [23; 37) 'return unknown': !
383 [30; 37) 'unknown': u32
384 "###
385 );
386}
387
388#[test]
373fn coerce_autoderef() { 389fn coerce_autoderef() {
374 assert_snapshot!( 390 assert_snapshot!(
375 infer_with_mismatches(r#" 391 infer_with_mismatches(r#"