Rollup merge of #70681 - rcoh:russell/70677-raw-str-panic, r=petrochenkov
Handle unterminated raw strings with no #s properly The modified code to handle parsing raw strings didn't properly account for the case where there was no "#" on either end and erroneously reported this strings as complete. This lead to a panic trying to read off the end of the file. Fixes #70677 r? @petrochenkov cc @Centril
This commit is contained in:
commit
ec0da7222d
4 changed files with 49 additions and 1 deletions
|
|
@ -0,0 +1,5 @@
|
|||
// This won't actually panic because of the error comment -- the `"` needs to be
|
||||
// the last byte in the file (including not having a trailing newline)
|
||||
// Prior to the fix you get the error: 'expected item, found `r" ...`'
|
||||
// because the string being unterminated wasn't properly detected.
|
||||
r" //~ unterminated raw string
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
error[E0748]: unterminated raw string
|
||||
--> $DIR/issue-70677-panic-on-unterminated-raw-str-at-eof.rs:5:1
|
||||
|
|
||||
LL | r"
|
||||
| ^ unterminated raw string
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0748`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue