gcc/rust/ChangeLog:
* ast/rust-ast.cc (AttributeParser::parse_path_meta_item): Catch
parse_expr returning nullptr and remove defunct comment.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
skip_token ();
std::unique_ptr<Expr> expr = parser->parse_expr ();
- // stream_pos++;
- /* shouldn't be required anymore due to parsing literal actually
- * skipping the token */
+
+ // handle error
+ // parse_expr should already emit an error and return nullptr
+ if (!expr)
+ return nullptr;
+
return std::unique_ptr<MetaItemPathExpr> (
new MetaItemPathExpr (std::move (path), std::move (expr)));
}