]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: lang-items: Add From::from
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 23 Jan 2025 11:46:48 +0000 (11:46 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 24 Mar 2025 12:06:58 +0000 (13:06 +0100)
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 b37a237c24e6901dea220e3af995ff0dd0e935e0..145054ff9d723602bef2b5b73eaeb0c415bcaef7 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 851909d409c0b39ddffc545b8c8e9c9831e43fa0..f30b93609b5e95bb4ce452771c2c7fe37c55495f 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;