mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
provide error message when using more than 65535 hash symbols for raw strings
This commit is contained in:
parent
c40275b34f
commit
313d6c53df
@ -1452,6 +1452,13 @@ impl<'a> StringReader<'a> {
|
||||
self.bump();
|
||||
let mut hash_count: u16 = 0;
|
||||
while self.ch_is('#') {
|
||||
if hash_count == 65535 {
|
||||
let bpos = self.next_pos;
|
||||
self.fatal_span_(start_bpos,
|
||||
bpos,
|
||||
"too many `#` symbols: raw strings may be \
|
||||
delimited by up to 65535 `#` symbols").raise();
|
||||
}
|
||||
self.bump();
|
||||
hash_count += 1;
|
||||
}
|
||||
@ -1682,6 +1689,13 @@ impl<'a> StringReader<'a> {
|
||||
self.bump();
|
||||
let mut hash_count = 0;
|
||||
while self.ch_is('#') {
|
||||
if hash_count == 65535 {
|
||||
let bpos = self.next_pos;
|
||||
self.fatal_span_(start_bpos,
|
||||
bpos,
|
||||
"too many `#` symbols: raw byte strings may be \
|
||||
delimited by up to 65535 `#` symbols").raise();
|
||||
}
|
||||
self.bump();
|
||||
hash_count += 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user