From d67eabb512a08a451a649c7f20e4e9ae1860a8a0 Mon Sep 17 00:00:00 2001 From: Marcus Klaas de Vries Date: Mon, 14 Jan 2019 20:56:14 +0100 Subject: Fix type inference for raw (byte) strings --- crates/ra_hir/src/ty/tests.rs | 12 +++++++++--- crates/ra_hir/src/ty/tests/data/literals.txt | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir/src/ty') 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) { #[test] fn infer_literals() { check_inference( - r#" + r##" fn test() { 5i32; "hello"; @@ -146,8 +146,14 @@ fn test() { 5000; false; true; -} -"#, + r#" + //! doc + // non-doc + mod foo {} + "#; + br#"yolo"#; +} +"##, "literals.txt", ); } 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 @@ -[11; 111) '{ ...rue; }': () +[11; 201) '{ ...o"#; }': () [17; 21) '5i32': i32 [27; 34) '"hello"': &str [40; 48) 'b"bytes"': &[u8] @@ -8,3 +8,5 @@ [83; 87) '5000': i32 [93; 98) 'false': bool [104; 108) 'true': bool +[114; 182) 'r#" ... "#': &str +[188; 198) 'br#"yolo"#': &[u8] -- cgit v1.2.3