https://gcc.gnu.org/g:14d04e93cf83d167c650709c9f09aa5267cf71c5
commit r15-8741-g14d04e93cf83d167c650709c9f09aa5267cf71c5 Author: Arthur Cohen <arthur.co...@embecosm.com> Date: Wed Jan 22 12:37:58 2025 +0000 gccrs: mappings: Improve error message for get_lang_item_node gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::get_lang_item_node): Better formatting when a lang item does not exist when it should. Diff: --- gcc/rust/util/rust-hir-map.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc index 39c3a98f16bc..e58f1a2a715c 100644 --- a/gcc/rust/util/rust-hir-map.cc +++ b/gcc/rust/util/rust-hir-map.cc @@ -1305,8 +1305,8 @@ Mappings::get_lang_item_node (LangItem::Kind item_type) if (auto lookup = lookup_lang_item_node (item_type)) return *lookup; - rust_fatal_error (UNKNOWN_LOCATION, "failed to find lang item %qs", - LangItem::ToString (item_type).c_str ()); + rust_fatal_error (UNKNOWN_LOCATION, "undeclared lang item: %qs", + LangItem::PrettyString (item_type).c_str ()); } void