Always emit trailing slash error
This commit is contained in:
parent
4bc1ce7bdb
commit
e26e6749fb
@ -191,7 +191,7 @@ pub(crate) fn emit_unescape_error(
|
||||
handler.span_err(span, "empty character literal")
|
||||
}
|
||||
EscapeError::LoneSlash => {
|
||||
panic!("lexer accepted unterminated literal with trailing slash")
|
||||
handler.span_err(span, "invalid trailing slash in literal")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
3
src/test/ui/parser/issue-62913.rs
Normal file
3
src/test/ui/parser/issue-62913.rs
Normal file
@ -0,0 +1,3 @@
|
||||
"\u\\"
|
||||
//~^ ERROR incorrect unicode escape sequence
|
||||
//~| ERROR invalid trailing slash in literal
|
16
src/test/ui/parser/issue-62913.stderr
Normal file
16
src/test/ui/parser/issue-62913.stderr
Normal file
@ -0,0 +1,16 @@
|
||||
error: incorrect unicode escape sequence
|
||||
--> $DIR/issue-62913.rs:1:2
|
||||
|
|
||||
LL | "\u\"
|
||||
| ^^^ incorrect unicode escape sequence
|
||||
|
|
||||
= help: format of unicode escape sequences is `\u{...}`
|
||||
|
||||
error: invalid trailing slash in literal
|
||||
--> $DIR/issue-62913.rs:1:5
|
||||
|
|
||||
LL | "\u\"
|
||||
| ^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user