]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mappings: Improve error message for get_lang_item_node
authorArthur Cohen <arthur.cohen@embecosm.com>
Wed, 22 Jan 2025 12:37:58 +0000 (12:37 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Tue, 28 Jan 2025 17:35:37 +0000 (17:35 +0000)
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.

gcc/rust/util/rust-hir-map.cc

index 4d2927281a21d9b54ed42a185c6b25e41f7af726..99839eb6701e0bc006d46fd981fe5a0b173aa1d3 100644 (file)
@@ -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