From ede65c2801c05b3c60f13b1f7fb434567fb97447 Mon Sep 17 00:00:00 2001 From: jjasmine Date: Fri, 1 Mar 2024 16:40:17 -0500 Subject: [PATCH] Add curly brackets, formatted clang 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 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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 8717c51e34ae..e5a4f2348712 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc @@ -127,13 +127,20 @@ Late::visit (AST::IdentifierExpr &expr) auto value = ctx.values.get (expr.get_ident ()); if (label) - resolved = label; + { + resolved = label; + } else if (value) - resolved = value; - else { - rust_error_at(expr.get_locus (), "could not resolve identifier expression: %qs", expr.get_ident ().as_string ().c_str ()); + { + resolved = value; + } + 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);