mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Correctly escape strings in our quote macro
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢 With this change and #18085 together, all remaining errors are type errors. This may mean we can enable more errors, but this is out of scope for this PR.
This commit is contained in:
parent
f13c776361
commit
7c44d453c8
3 changed files with 25 additions and 6 deletions
|
@ -528,3 +528,21 @@ fn main() { foobar; }
|
|||
"##]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_quote_string() {
|
||||
check(
|
||||
r##"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! stringify {}
|
||||
|
||||
fn main() { stringify!("hello"); }
|
||||
"##,
|
||||
expect![[r##"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! stringify {}
|
||||
|
||||
fn main() { "\"hello\""; }
|
||||
"##]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue