aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorMarcus Klaas de Vries <[email protected]>2019-01-26 18:25:57 +0000
committerMarcus Klaas de Vries <[email protected]>2019-01-27 16:59:21 +0000
commitf6eb44cd9e2a27d2004386c71fb6c72f79ba83b3 (patch)
tree7d8b00f84f2ccf53983f7a40f9c93e2a6820fafd /crates/ra_hir/src/ty
parent0da1e8b2f8709cbdb20912664878121d979a5213 (diff)
Use type information from the turbofish
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap7
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap8
-rw-r--r--crates/ra_hir/src/ty/tests.rs3
3 files changed, 12 insertions, 6 deletions
diff --git a/crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap b/crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap
index 84fbe6e4c..85aeefa0c 100644
--- a/crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap
+++ b/crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap
@@ -1,5 +1,5 @@
1--- 1---
2created: "2019-01-26T17:46:03.963745056+00:00" 2created: "2019-01-26T18:16:16.568375+00:00"
3creator: [email protected] 3creator: [email protected]
4expression: "&result" 4expression: "&result"
5source: crates/ra_hir/src/ty/tests.rs 5source: 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; 138) '{ ...(z); }': () 13[77; 197) '{ ...(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,4 +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
24[173; 194) 'id::<i...ng>(1)': i32
25[192; 193) '1': i32
23 26
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap
index 369705f84..8ff6e55a6 100644
--- a/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap
@@ -1,5 +1,5 @@
1--- 1---
2created: "2019-01-26T17:46:03.856278205+00:00" 2created: "2019-01-26T18:16:16.530712344+00:00"
3creator: [email protected] 3creator: [email protected]
4expression: "&result" 4expression: "&result"
5source: crates/ra_hir/src/ty/tests.rs 5source: crates/ra_hir/src/ty/tests.rs
@@ -11,9 +11,9 @@ source: crates/ra_hir/src/ty/tests.rs
11[44; 46) 'id': fn id<u32>(T) -> T 11[44; 46) 'id': fn id<u32>(T) -> T
12[44; 52) 'id(1u32)': u32 12[44; 52) 'id(1u32)': u32
13[47; 51) '1u32': u32 13[47; 51) '1u32': u32
14[58; 68) 'id::<i128>': fn id<i32>(T) -> T 14[58; 68) 'id::<i128>': fn id<i128>(T) -> T
15[58; 71) 'id::<i128>(1)': i32 15[58; 71) 'id::<i128>(1)': i128
16[69; 70) '1': i32 16[69; 70) '1': i128
17[81; 82) 'x': u64 17[81; 82) 'x': u64
18[90; 92) 'id': fn id<u64>(T) -> T 18[90; 92) 'id': fn id<u64>(T) -> T
19[90; 95) 'id(1)': u64 19[90; 95) 'id(1)': u64
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index 40913b164..fac566626 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -611,6 +611,9 @@ 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
615 // bad turbofish - ignore!
616 id::<i128, String>(1);
614} 617}
615"#, 618"#,
616 ); 619 );