You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
write_literal doesn't correctly handle raw strings.
Reproducer
I tried this code:
writeln!(
pre,"{}",r#"$#CON colcheck "Use the sum of col {{index[0]}} for {{index[1]}}"find colcheck: matrix indexed by [int(1..width), ALLRANGE] of bool"#")?;
I expected write_literal to rewrite this to valid Rust. Instead, this happened:
writeln!(
pre,"$#CON colcheck \\"Use the sum of col {{{{index[0]}}}}for{{{{index[1]}}}}\\"
find colcheck: matrix indexed by [int(1..width),ALLRANGE] of bool")?;
My preference would be to just leave the raw string as is, I can't see why that wouldn't be the easist, and least-suprising option.
Summary
write_literal doesn't correctly handle raw strings.
Reproducer
I tried this code:
I expected write_literal to rewrite this to valid Rust. Instead, this happened:
My preference would be to just leave the raw string as is, I can't see why that wouldn't be the easist, and least-suprising option.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: