Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gcc/rust/lex/rust-lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1894,18 +1894,18 @@ Lexer::parse_raw_byte_string (location_t loc)
break;
}
}
else if (current_char.is_eof ())
{
rust_error_at (string_begin_locus, "unended raw byte string literal");
return Token::make (END_OF_FILE, get_current_location ());
}
else if (current_char.value > 127)
{
rust_error_at (get_current_location (),
"character %<%s%> in raw byte string out of range",
current_char.as_string ().c_str ());
current_char = 0;
}
else if (current_char.is_eof ())
{
rust_error_at (string_begin_locus, "unended raw byte string literal");
return Token::make (END_OF_FILE, get_current_location ());
}

length++;
current_column++;
Expand Down
6 changes: 6 additions & 0 deletions gcc/testsuite/rust/compile/torture/unended-raw-byte-string.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// { dg-excess-errors "...." }
fn main() {
// { dg-error "unended raw byte string literal" "" { target *-*-* } .+1 }
let s = br##"123"#
}