From 92874edab8f6a22c9c0f05eabd45be792c354a71 Mon Sep 17 00:00:00 2001 From: jjasmine Date: Fri, 1 Mar 2024 05:31:15 -0500 Subject: [PATCH] Add error emitting when we can't resolve id expr 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 f9731a451a3a..8717c51e34ae 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);