mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Fix type inference for raw (byte) strings
This commit is contained in:
parent
2689348772
commit
d67eabb512
7 changed files with 119 additions and 65 deletions
|
@ -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",
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue