diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-14 19:56:14 +0000 |
---|---|---|
committer | Marcus Klaas de Vries <[email protected]> | 2019-01-14 19:56:14 +0000 |
commit | d67eabb512a08a451a649c7f20e4e9ae1860a8a0 (patch) | |
tree | 99c5fb5004f3fb7a6b0855033855c439675cc0ff /crates/ra_hir/src/ty | |
parent | 26893487722d07b3f31a6addfc88e6948620989c (diff) |
Fix type inference for raw (byte) strings
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 12 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests/data/literals.txt | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index cbdb2a4b7..8aacb1a7f 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -135,7 +135,7 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { | |||
135 | #[test] | 135 | #[test] |
136 | fn infer_literals() { | 136 | fn infer_literals() { |
137 | check_inference( | 137 | check_inference( |
138 | r#" | 138 | r##" |
139 | fn test() { | 139 | fn test() { |
140 | 5i32; | 140 | 5i32; |
141 | "hello"; | 141 | "hello"; |
@@ -146,8 +146,14 @@ fn test() { | |||
146 | 5000; | 146 | 5000; |
147 | false; | 147 | false; |
148 | true; | 148 | true; |
149 | } | 149 | r#" |
150 | "#, | 150 | //! doc |
151 | // non-doc | ||
152 | mod foo {} | ||
153 | "#; | ||
154 | br#"yolo"#; | ||
155 | } | ||
156 | "##, | ||
151 | "literals.txt", | 157 | "literals.txt", |
152 | ); | 158 | ); |
153 | } | 159 | } |
diff --git a/crates/ra_hir/src/ty/tests/data/literals.txt b/crates/ra_hir/src/ty/tests/data/literals.txt index 6e82f458f..84ee2c11b 100644 --- a/crates/ra_hir/src/ty/tests/data/literals.txt +++ b/crates/ra_hir/src/ty/tests/data/literals.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | [11; 111) '{ ...rue; }': () | 1 | [11; 201) '{ ...o"#; }': () |
2 | [17; 21) '5i32': i32 | 2 | [17; 21) '5i32': i32 |
3 | [27; 34) '"hello"': &str | 3 | [27; 34) '"hello"': &str |
4 | [40; 48) 'b"bytes"': &[u8] | 4 | [40; 48) 'b"bytes"': &[u8] |
@@ -8,3 +8,5 @@ | |||
8 | [83; 87) '5000': i32 | 8 | [83; 87) '5000': i32 |
9 | [93; 98) 'false': bool | 9 | [93; 98) 'false': bool |
10 | [104; 108) 'true': bool | 10 | [104; 108) 'true': bool |
11 | [114; 182) 'r#" ... "#': &str | ||
12 | [188; 198) 'br#"yolo"#': &[u8] | ||