diff options
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/snapshots/tests__infer_type_param.snap (renamed from crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap) | 10 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_type_param.snap index 85aeefa0c..a99323264 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_type_param.snap | |||
@@ -1,5 +1,5 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-26T18:16:16.568375+00:00" | 2 | created: "2019-01-27T16:54:18.368427685+00:00" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: crates/ra_hir/src/ty/tests.rs | 5 | source: crates/ra_hir/src/ty/tests.rs |
@@ -10,7 +10,7 @@ source: crates/ra_hir/src/ty/tests.rs | |||
10 | [44; 45) 'x': &[unknown] | 10 | [44; 45) 'x': &[unknown] |
11 | [56; 65) '{ x }': &[unknown] | 11 | [56; 65) '{ x }': &[unknown] |
12 | [62; 63) 'x': &[unknown] | 12 | [62; 63) 'x': &[unknown] |
13 | [77; 197) '{ ...(1); }': () | 13 | [77; 157) '{ ...(1); }': () |
14 | [87; 88) 'y': u32 | 14 | [87; 88) 'y': u32 |
15 | [91; 96) '10u32': u32 | 15 | [91; 96) '10u32': u32 |
16 | [102; 104) 'id': fn id<u32>(T) -> T | 16 | [102; 104) 'id': fn id<u32>(T) -> T |
@@ -20,7 +20,7 @@ source: crates/ra_hir/src/ty/tests.rs | |||
20 | [127; 132) 'clone': fn clone<bool>(&T) -> T | 20 | [127; 132) 'clone': fn clone<bool>(&T) -> T |
21 | [127; 135) 'clone(z)': bool | 21 | [127; 135) 'clone(z)': bool |
22 | [133; 134) 'z': &bool | 22 | [133; 134) 'z': &bool |
23 | [173; 191) 'id::<i...tring>': fn id<i32>(T) -> T | 23 | [141; 151) 'id::<i128>': fn id<i128>(T) -> T |
24 | [173; 194) 'id::<i...ng>(1)': i32 | 24 | [141; 154) 'id::<i128>(1)': i128 |
25 | [192; 193) '1': i32 | 25 | [152; 153) '1': i128 |
26 | 26 | ||
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index fac566626..ac12d974b 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -597,7 +597,7 @@ fn test() { | |||
597 | #[test] | 597 | #[test] |
598 | fn infer_type_param() { | 598 | fn infer_type_param() { |
599 | check_inference( | 599 | check_inference( |
600 | "generic_fn", | 600 | "infer_type_param", |
601 | r#" | 601 | r#" |
602 | fn id<T>(x: T) -> T { | 602 | fn id<T>(x: T) -> T { |
603 | x | 603 | x |
@@ -611,9 +611,7 @@ fn test() { | |||
611 | let y = 10u32; | 611 | let y = 10u32; |
612 | id(y); | 612 | id(y); |
613 | let x: bool = clone(z); | 613 | let x: bool = clone(z); |
614 | 614 | id::<i128>(1); | |
615 | // bad turbofish - ignore! | ||
616 | id::<i128, String>(1); | ||
617 | } | 615 | } |
618 | "#, | 616 | "#, |
619 | ); | 617 | ); |