error prefix-literal
What it means#
A prefixed literal p"..." calls the comptime literal fn p in scope (§1.5, §15.3). When the handler returns a CompileError, for example a malformed regular expression or an unknown time zone, the error is placed at the literal. The text is passed verbatim, without escapes (D-003).
Example#
fn main() {
let r = re"(unclosed" // <- prefix-literal
}error
prefix-literal
How to fix#
fn main() {
let r = re"\(unclosed"
}Make the literal valid for its handler. Check the handler's documentation for the accepted syntax.