Fix type inference for raw (byte) strings

This commit is contained in:
Marcus Klaas de Vries 2019-01-14 20:56:14 +01:00
parent 2689348772
commit d67eabb512
7 changed files with 119 additions and 65 deletions

View file

@ -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",
);
}

View file

@ -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]