Fix a new warning on Cygwin
[binutils-gdb.git] / gdb / rust-parse.c
index 4006df7086bb4e9816bba5a8a8136d75a644aa7f..7d7d882872cec6e4898c1847528da840afd03eb3 100644 (file)
@@ -271,7 +271,10 @@ struct rust_parser
   operation_up parse_entry_point ()
   {
     lex ();
-    return parse_expr ();
+    operation_up result = parse_expr ();
+    if (current_token != 0)
+      error (_("Syntax error near '%s'"), pstate->prev_lexptr);
+    return result;
   }
 
   operation_up parse_tuple ();
@@ -2020,6 +2023,7 @@ rust_parser::parse_atom (bool required)
 
     case STRING:
       result = parse_string ();
+      lex ();
       break;
 
     case BYTESTRING: