From f6eb44cd9e2a27d2004386c71fb6c72f79ba83b3 Mon Sep 17 00:00:00 2001 From: Marcus Klaas de Vries Date: Sat, 26 Jan 2019 19:25:57 +0100 Subject: Use type information from the turbofish --- crates/ra_hir/src/ty/snapshots/tests__generic_fn.snap | 7 +++++-- .../ra_hir/src/ty/snapshots/tests__infer_function_generics.snap | 8 ++++---- crates/ra_hir/src/ty/tests.rs | 3 +++ 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src/ty') 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 @@ --- -created: "2019-01-26T17:46:03.963745056+00:00" +created: "2019-01-26T18:16:16.568375+00:00" creator: insta@0.5.2 expression: "&result" source: crates/ra_hir/src/ty/tests.rs @@ -10,7 +10,7 @@ source: crates/ra_hir/src/ty/tests.rs [44; 45) 'x': &[unknown] [56; 65) '{ x }': &[unknown] [62; 63) 'x': &[unknown] -[77; 138) '{ ...(z); }': () +[77; 197) '{ ...(1); }': () [87; 88) 'y': u32 [91; 96) '10u32': u32 [102; 104) 'id': fn id(T) -> T @@ -20,4 +20,7 @@ source: crates/ra_hir/src/ty/tests.rs [127; 132) 'clone': fn clone(&T) -> T [127; 135) 'clone(z)': bool [133; 134) 'z': &bool +[173; 191) 'id::': fn id(T) -> T +[173; 194) 'id::(1)': i32 +[192; 193) '1': i32 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 @@ --- -created: "2019-01-26T17:46:03.856278205+00:00" +created: "2019-01-26T18:16:16.530712344+00:00" creator: insta@0.5.2 expression: "&result" source: crates/ra_hir/src/ty/tests.rs @@ -11,9 +11,9 @@ source: crates/ra_hir/src/ty/tests.rs [44; 46) 'id': fn id(T) -> T [44; 52) 'id(1u32)': u32 [47; 51) '1u32': u32 -[58; 68) 'id::': fn id(T) -> T -[58; 71) 'id::(1)': i32 -[69; 70) '1': i32 +[58; 68) 'id::': fn id(T) -> T +[58; 71) 'id::(1)': i128 +[69; 70) '1': i128 [81; 82) 'x': u64 [90; 92) 'id': fn id(T) -> T [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() { let y = 10u32; id(y); let x: bool = clone(z); + + // bad turbofish - ignore! + id::(1); } "#, ); -- cgit v1.2.3