Commit Message
Arthur Cohen
Aug. 1, 2024, 2:56 p.m. UTC
From: jjasmine <tanghocle456@gmail.com>
gcc/rust/ChangeLog:
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add error emitting
---
gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc index f9731a451a3..8717c51e34a 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc @@ -130,7 +130,10 @@ Late::visit (AST::IdentifierExpr &expr) resolved = label; else if (value) resolved = value; - // TODO: else emit error? + else { + rust_error_at(expr.get_locus (), "could not resolve identifier expression: %qs", expr.get_ident ().as_string ().c_str ()); + return; + } ctx.map_usage (expr.get_node_id (), *resolved);