]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: 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)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:06:54 +0000 (13:06 +0100)
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 39c3a98f16bc47f04a7161336aed975d1511f1b8..e58f1a2a715cbd5199a8695e95d10ab83070f36e 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