From 6210e82041849bad6129331b9e45ac0bae6fe569 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 6 Jan 2019 16:47:59 +0100 Subject: Use HIR Expr for type inference Now we can reuse the type inference inside a function when typing whitespace etc. :) --- crates/ra_hir/src/ty/tests/data/0001_basics.txt | 2 +- crates/ra_hir/src/ty/tests/data/0004_struct.txt | 2 +- crates/ra_hir/src/ty/tests/data/0005_refs.txt | 4 ++-- crates/ra_hir/src/ty/tests/data/0006_backwards.txt | 6 +++--- crates/ra_hir/src/ty/tests/data/0008_boolean_op.txt | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'crates/ra_hir/src/ty/tests/data') diff --git a/crates/ra_hir/src/ty/tests/data/0001_basics.txt b/crates/ra_hir/src/ty/tests/data/0001_basics.txt index 212e92e00..4df6b42c9 100644 --- a/crates/ra_hir/src/ty/tests/data/0001_basics.txt +++ b/crates/ra_hir/src/ty/tests/data/0001_basics.txt @@ -8,6 +8,6 @@ [27; 28) 'c': ! [62; 63) 'c': ! [17; 18) 'b': isize -[100; 106) '"test"': [unknown] [42; 121) '{ ...f32; }': () +[100; 106) '"test"': [unknown] [69; 70) 'd': &[unknown] diff --git a/crates/ra_hir/src/ty/tests/data/0004_struct.txt b/crates/ra_hir/src/ty/tests/data/0004_struct.txt index b4af18b87..6f919b332 100644 --- a/crates/ra_hir/src/ty/tests/data/0004_struct.txt +++ b/crates/ra_hir/src/ty/tests/data/0004_struct.txt @@ -1,8 +1,8 @@ [86; 90) 'C(1)': [unknown] [121; 122) 'B': B [86; 87) 'C': [unknown] -[129; 130) '1': [unknown] [107; 108) 'a': A +[129; 130) '1': [unknown] [127; 128) 'C': [unknown] [139; 142) 'a.b': B [114; 133) 'A { b:...C(1) }': A diff --git a/crates/ra_hir/src/ty/tests/data/0005_refs.txt b/crates/ra_hir/src/ty/tests/data/0005_refs.txt index 296e955c1..cc32162a1 100644 --- a/crates/ra_hir/src/ty/tests/data/0005_refs.txt +++ b/crates/ra_hir/src/ty/tests/data/0005_refs.txt @@ -6,9 +6,9 @@ [46; 47) 'd': *mut u32 [59; 150) '{ ... *d; }': () [116; 117) 'b': &mut u32 +[72; 74) '*a': u32 [131; 132) 'c': *const u32 [130; 132) '*c': u32 -[72; 74) '*a': u32 [107; 109) '*b': u32 [108; 109) 'b': &mut u32 [9; 10) 'a': &u32 @@ -17,7 +17,7 @@ [100; 101) 'b': &mut u32 [81; 82) 'a': &u32 [80; 82) '&a': &&u32 -[73; 74) 'a': &u32 [123; 124) 'c': *const u32 +[73; 74) 'a': &u32 [31; 32) 'c': *const u32 [138; 139) 'd': *mut u32 diff --git a/crates/ra_hir/src/ty/tests/data/0006_backwards.txt b/crates/ra_hir/src/ty/tests/data/0006_backwards.txt index 120069401..0efae598e 100644 --- a/crates/ra_hir/src/ty/tests/data/0006_backwards.txt +++ b/crates/ra_hir/src/ty/tests/data/0006_backwards.txt @@ -1,12 +1,12 @@ [22; 24) '{}': () [14; 15) 'x': u32 [142; 158) 'unknow...nction': [unknown] -[126; 127) 'a': u32 -[198; 216) 'unknow...tion()': f64 [228; 229) 'c': f64 +[198; 216) 'unknow...tion()': f64 +[126; 127) 'a': u32 [198; 214) 'unknow...nction': [unknown] -[166; 184) 'S { i3...d: b }': S [222; 229) '&mut &c': &mut &f64 +[166; 184) 'S { i3...d: b }': S [194; 195) 'c': f64 [92; 110) 'unknow...tion()': u32 [142; 160) 'unknow...tion()': i32 diff --git a/crates/ra_hir/src/ty/tests/data/0008_boolean_op.txt b/crates/ra_hir/src/ty/tests/data/0008_boolean_op.txt index ca01ad159..0ae172914 100644 --- a/crates/ra_hir/src/ty/tests/data/0008_boolean_op.txt +++ b/crates/ra_hir/src/ty/tests/data/0008_boolean_op.txt @@ -1,31 +1,31 @@ [28; 32) '0i32': i32 [22; 34) '{ 0i32 }': i32 [6; 7) 'x': [unknown] -[127; 134) 'CONST_1': [unknown] [201; 205) '3i32': bool +[127; 134) 'CONST_1': [unknown] [76; 77) 'y': bool -[65; 66) 'b': bool [60; 66) 'a && b': bool +[65; 66) 'b': bool +[229; 231) '10': [unknown] [127; 145) 'CONST_...ONST_2': bool [182; 183) 'd': [unknown] -[229; 231) '10': [unknown] [209; 222) '"hello world"': bool [229; 235) '10 < 3': bool [186; 187) 'b': [unknown] -[159; 172) 'f(z || y) + 5': [unknown] [56; 57) 'x': bool +[159; 172) 'f(z || y) + 5': [unknown] [112; 113) 'y': bool -[201; 222) '3i32 &...world"': bool [234; 235) '3': [unknown] +[201; 222) '3i32 &...world"': bool [138; 145) 'CONST_2': [unknown] [80; 93) 'true || false': bool [46; 237) '{ ... < 3 }': bool [197; 198) 'e': bool [107; 113) 'x == y': bool [88; 93) 'false': bool -[80; 84) 'true': bool -[123; 124) 'h': bool [155; 156) 'c': [unknown] +[123; 124) 'h': bool +[80; 84) 'true': bool [103; 104) 'z': bool [60; 61) 'a': bool [107; 108) 'x': bool -- cgit v1.2.3