Skip to content

Commit

Permalink
lang-items: Add From::from
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* util/rust-lang-item.h: Declare it.
	* util/rust-lang-item.cc: Use it.
  • Loading branch information
CohenArthur committed Jan 23, 2025
1 parent 0a12536 commit 51942a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gcc/rust/util/rust-lang-item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions gcc/rust/util/rust-lang-item.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ class LangItem
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;
Expand Down

0 comments on commit 51942a9

Please sign in to comment.