From f7ff6020f8c68e4fb54c17c4460aa7f8a31f85bd Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 1 Mar 2022 17:20:29 +0100 Subject: lexer: Improve safety by taking ownership of the tokenized string Co-authored-by: philberty --- gcc/rust/lex/rust-lex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h index b0d7494..c50f632 100644 --- a/gcc/rust/lex/rust-lex.h +++ b/gcc/rust/lex/rust-lex.h @@ -144,7 +144,7 @@ public: /** * Lex the contents of a string instead of a file */ - static Lexer lex_string (std::string &input) + static Lexer lex_string (std::string input) { // We can perform this ugly cast to a non-const char* since we're only // *reading* the string. This would not be valid if we were doing any -- cgit v1.1