From 18b0bd9bffeeeaf664f4a21894d5bfff51e82b32 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Mon, 25 Feb 2019 09:27:47 +0200 Subject: Add const type inference --- .../src/ty/snapshots/tests__infer_associated_const.snap | 14 +++++++------- crates/ra_hir/src/ty/snapshots/tests__infer_const.snap | 14 ++++++++++++++ crates/ra_hir/src/ty/snapshots/tests__infer_static.snap | 16 ++++++++++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 crates/ra_hir/src/ty/snapshots/tests__infer_const.snap create mode 100644 crates/ra_hir/src/ty/snapshots/tests__infer_static.snap (limited to 'crates/ra_hir/src/ty/snapshots') diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_associated_const.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_associated_const.snap index 131d1fa16..51f3fd4c0 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_associated_const.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_associated_const.snap @@ -1,14 +1,14 @@ --- -created: "2019-02-21T21:51:46.497925200Z" +created: "2019-02-25T08:36:33.885804400Z" creator: insta@0.6.3 source: crates/ra_hir/src/ty/tests.rs expression: "&result" --- [227; 305) '{ ...:ID; }': () -[237; 238) 'x': [unknown] -[241; 252) 'Struct::FOO': [unknown] -[262; 263) 'y': [unknown] -[266; 275) 'Enum::BAR': [unknown] -[285; 286) 'z': [unknown] -[289; 302) 'TraitTest::ID': [unknown] +[237; 238) 'x': u32 +[241; 252) 'Struct::FOO': u32 +[262; 263) 'y': u32 +[266; 275) 'Enum::BAR': u32 +[285; 286) 'z': u32 +[289; 302) 'TraitTest::ID': u32 diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_const.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_const.snap new file mode 100644 index 000000000..a5eba3980 --- /dev/null +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_const.snap @@ -0,0 +1,14 @@ +--- +created: "2019-02-25T07:26:34.115351100Z" +creator: insta@0.6.3 +source: crates/ra_hir/src/ty/tests.rs +expression: "&result" +--- +[95; 213) '{ ...NST; }': () +[138; 139) 'x': [unknown] +[142; 153) 'LOCAL_CONST': [unknown] +[163; 164) 'z': u32 +[167; 179) 'GLOBAL_CONST': u32 +[189; 191) 'id': u32 +[194; 210) 'Foo::A..._CONST': u32 + diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap new file mode 100644 index 000000000..ffe9ca66d --- /dev/null +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap @@ -0,0 +1,16 @@ +--- +created: "2019-02-25T07:26:41.480764900Z" +creator: insta@0.6.3 +source: crates/ra_hir/src/ty/tests.rs +expression: "&result" +--- +[85; 280) '{ ...MUT; }': () +[173; 174) 'x': [unknown] +[177; 189) 'LOCAL_STATIC': [unknown] +[199; 200) 'y': [unknown] +[203; 219) 'LOCAL_...IC_MUT': [unknown] +[229; 230) 'z': [unknown] +[233; 246) 'GLOBAL_STATIC': [unknown] +[256; 257) 'w': [unknown] +[260; 277) 'GLOBAL...IC_MUT': [unknown] + -- cgit v1.2.3 From 29f93a79069cf929fbc6d4efa194a0ab18bb1f45 Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Mon, 25 Feb 2019 10:21:01 +0200 Subject: Add static type inference --- crates/ra_hir/src/ty/snapshots/tests__infer_static.snap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src/ty/snapshots') diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap index ffe9ca66d..5d90f56ed 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_static.snap @@ -1,5 +1,5 @@ --- -created: "2019-02-25T07:26:41.480764900Z" +created: "2019-02-25T08:20:17.807316Z" creator: insta@0.6.3 source: crates/ra_hir/src/ty/tests.rs expression: "&result" @@ -9,8 +9,8 @@ expression: "&result" [177; 189) 'LOCAL_STATIC': [unknown] [199; 200) 'y': [unknown] [203; 219) 'LOCAL_...IC_MUT': [unknown] -[229; 230) 'z': [unknown] -[233; 246) 'GLOBAL_STATIC': [unknown] -[256; 257) 'w': [unknown] -[260; 277) 'GLOBAL...IC_MUT': [unknown] +[229; 230) 'z': u32 +[233; 246) 'GLOBAL_STATIC': u32 +[256; 257) 'w': u32 +[260; 277) 'GLOBAL...IC_MUT': u32 -- cgit v1.2.3