Skip to content

Commit f7ff602

Browse files
lexer: Improve safety by taking ownership of the tokenized string
Co-authored-by: philberty <philip.herron@embecosm.com>
1 parent 49dcecd commit f7ff602

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcc/rust/lex/rust-lex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Lexer
144144
/**
145145
* Lex the contents of a string instead of a file
146146
*/
147-
static Lexer lex_string (std::string &input)
147+
static Lexer lex_string (std::string input)
148148
{
149149
// We can perform this ugly cast to a non-const char* since we're only
150150
// *reading* the string. This would not be valid if we were doing any

0 commit comments

Comments
 (0)