Enclosing it in triple quotes (multiline) works:
val s = raw"""\\\"""
https://scastie.scala-lang.org/z3YT2nwiTdua7avCIn5YmA
Here is PR which seems to be related to the issue:
\" no longer closes single-quoted interpolated string literals.
The escape sequence is not processed by the scanner.
It seems that this part of the spec is "responsible":
interpolatedString ::= alphaid ‘"’ {[‘\’] interpolatedStringPart | ‘\\’ | ‘\"’} ‘"’
...
Note that the sequence " does not close a normal string literal (enclosed in single quotes).
i.e. \" is treated like two characters - | and " of the literal itself, hence:
val s = raw"\"" // represents \" string
works - https://scastie.scala-lang.org/TM5YTOHfQD2Pel6fHjgjOA