aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-29 20:02:39 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-29 20:02:39 +0100
commita5fe9f7a877bdb4dc35226d1cbac2b4870fde276 (patch)
tree578ec5757edfb8771a4c910479230db14055b020 /crates/ra_hir/src
parent359b3376b32b38548c71e2b6e3a7393c4396ccf6 (diff)
parentd79dc38e99f522be79b776b4b10090ecf175013c (diff)
Merge #1604
1604: Fix failing type interference for floating point literal r=matklad a=theotherphil Fixes https://github.com/rust-analyzer/rust-analyzer/issues/1592 Co-authored-by: Phil Ellison <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/ty/tests.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index 676711d0a..36dea17a3 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -334,6 +334,8 @@ fn infer_literals() {
334 infer(r##" 334 infer(r##"
335fn test() { 335fn test() {
336 5i32; 336 5i32;
337 5f32;
338 5f64;
337 "hello"; 339 "hello";
338 b"bytes"; 340 b"bytes";
339 'c'; 341 'c';
@@ -351,18 +353,20 @@ fn test() {
351} 353}
352"##), 354"##),
353 @r###" 355 @r###"
354[11; 201) '{ ...o"#; }': () 356[11; 221) '{ ...o"#; }': ()
355[17; 21) '5i32': i32 357[17; 21) '5i32': i32
356[27; 34) '"hello"': &str 358[27; 31) '5f32': f32
357[40; 48) 'b"bytes"': &[u8] 359[37; 41) '5f64': f64
358[54; 57) ''c'': char 360[47; 54) '"hello"': &str
359[63; 67) 'b'b'': u8 361[60; 68) 'b"bytes"': &[u8]
360[73; 77) '3.14': f64 362[74; 77) ''c'': char
361[83; 87) '5000': i32 363[83; 87) 'b'b'': u8
362[93; 98) 'false': bool 364[93; 97) '3.14': f64
363[104; 108) 'true': bool 365[103; 107) '5000': i32
364[114; 182) 'r#" ... "#': &str 366[113; 118) 'false': bool
365[188; 198) 'br#"yolo"#': &[u8]"### 367[124; 128) 'true': bool
368[134; 202) 'r#" ... "#': &str
369[208; 218) 'br#"yolo"#': &[u8]"###
366 ); 370 );
367} 371}
368 372