From a6146d35b1615cf5fb908b29f34e58bfde3bf96d Mon Sep 17 00:00:00 2001 From: Marcus Klaas de Vries Date: Thu, 10 Jan 2019 13:54:58 +0100 Subject: Implement type inference for literals (WIP) --- crates/ra_hir/src/ty/tests/data/basics.txt | 2 +- crates/ra_hir/src/ty/tests/data/literals.txt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 crates/ra_hir/src/ty/tests/data/literals.txt (limited to 'crates/ra_hir/src/ty/tests/data') diff --git a/crates/ra_hir/src/ty/tests/data/basics.txt b/crates/ra_hir/src/ty/tests/data/basics.txt index ac7faae0a..e02947ba8 100644 --- a/crates/ra_hir/src/ty/tests/data/basics.txt +++ b/crates/ra_hir/src/ty/tests/data/basics.txt @@ -9,5 +9,5 @@ [69; 70) 'd': &str [76; 82) '1usize': [unknown] [88; 94) '1isize': [unknown] -[100; 106) '"test"': [unknown] +[100; 106) '"test"': &str [112; 118) '1.0f32': [unknown] diff --git a/crates/ra_hir/src/ty/tests/data/literals.txt b/crates/ra_hir/src/ty/tests/data/literals.txt new file mode 100644 index 000000000..8b22eee31 --- /dev/null +++ b/crates/ra_hir/src/ty/tests/data/literals.txt @@ -0,0 +1,10 @@ +[11; 135) '{ ...lse] }': () +[17; 21) '5i32': [unknown] +[27; 34) '"hello"': &str +[40; 48) 'b"bytes"': &[u8] +[54; 57) ''c'': char +[63; 67) 'b'b'': u8 +[73; 77) '3.14': [unknown] +[83; 87) '5000': [unknown] +[93; 108) '(0u32, -5isize)': [unknown] +[114; 133) '[true,...false]': () -- cgit v1.2.3