You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gccrs: Report an error on an empty path expression
The path parser previously returned an error node silently when the
initial path segment failed to parse. Report a diagnostic for paths
beginning with ::, where the resulting error node could otherwise lead
to an ICE downstream.
Do not apply the guard to bare $, since undefined metavariables already
receive more specific diagnostics downstream. Remove the redundant
parse_stmt_or_expr guard, which otherwise reports the same error twice.
Fixes#4790
gcc/rust/ChangeLog:
* parse/rust-parse-impl-path.hxx (Parser::parse_path_in_expression):
Report an error when the initial segment of a scoped path fails to
parse.
* parse/rust-parse-impl.hxx (Parser::parse_stmt_or_expr): Remove the
redundant expected-identifier error guard.
gcc/testsuite/ChangeLog:
* rust/compile/empty_path2.rs: New test.
* rust/compile/empty_path3.rs: New test.
Signed-off-by: Utkarsh Bahuguna <utkarshbahuguna10@gmail.com>
0 commit comments