]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lang-items: Add From::from
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 23 Jan 2025 11:46:48 +0000 (11:46 +0000)
committerCohenArthur <arthur.cohen@embecosm.com>
Wed, 29 Jan 2025 16:26:25 +0000 (16:26 +0000)
gcc/rust/ChangeLog:

* util/rust-lang-item.h: Declare it.
* util/rust-lang-item.cc: Use it.

gcc/rust/util/rust-lang-item.cc
gcc/rust/util/rust-lang-item.h

index 6b8c6e4606b242c451267482ec3efceeed7c050c..091c6b67ea53b8744e8a4170db81b349ec0f49be 100644 (file)
@@ -110,6 +110,8 @@ const BiMap<std::string, LangItem::Kind> Rust::LangItem::lang_items = {{
   {"into_result", Kind::TRY_INTO_RESULT},
   {"from_error", Kind::TRY_FROM_ERROR},
   {"from_ok", Kind::TRY_FROM_OK},
+
+  {"from", Kind::FROM_FROM},
 }};
 
 tl::optional<LangItem::Kind>
index aa7efb12fcaca84b06366bad456c78dce0849a11..b5abf615d594f297b9d39f7234034c3796bc34af 100644 (file)
@@ -141,6 +141,9 @@ public:
     TRY_INTO_RESULT,
     TRY_FROM_ERROR,
     TRY_FROM_OK,
+
+    // NOTE: This is not a lang item in later versions of Rust
+    FROM_FROM,
   };
 
   static const BiMap<std::string, Kind> lang_items;