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);