Skip to content

Commit 3c21102

Browse files
committed
lang-items: Add From::from
gcc/rust/ChangeLog: * util/rust-lang-item.h: Declare it. * util/rust-lang-item.cc: Use it.
1 parent 618f41a commit 3c21102

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ const BiMap<std::string, LangItem::Kind> Rust::LangItem::lang_items = {{
110110
{"into_result", Kind::TRY_INTO_RESULT},
111111
{"from_error", Kind::TRY_FROM_ERROR},
112112
{"from_ok", Kind::TRY_FROM_OK},
113+
114+
{"from", Kind::FROM_FROM},
113115
}};
114116

115117
tl::optional<LangItem::Kind>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ class LangItem
141141
TRY_INTO_RESULT,
142142
TRY_FROM_ERROR,
143143
TRY_FROM_OK,
144+
145+
// NOTE: This is not a lang item in later versions of Rust
146+
FROM_FROM,
144147
};
145148

146149
static const BiMap<std::string, Kind> lang_items;

0 commit comments

Comments
 (0)