From 8bc2a3e40e86a6a125c985f05616537c130cb2cb Mon Sep 17 00:00:00 2001 From: Owen Avery Date: Mon, 3 Apr 2023 18:52:23 -0400 Subject: gccrs: Handle "fn" and "fn_mut" lang items gcc/rust/ChangeLog: * util/rust-lang-item.h (RustLangItem::ItemType::FN): Add. (RustLangItem::ItemType::FN_MUT): Add. (RustLangItem::Parse): Handle FN and FN_MUT. (RustLangItem::ToString): Handle FN and FN_MUT. Signed-off-by: Owen Avery --- gcc/rust/util/rust-lang-item.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index d7f6ad1..86323d9 100644 --- a/gcc/rust/util/rust-lang-item.h +++ b/gcc/rust/util/rust-lang-item.h @@ -72,6 +72,8 @@ public: PHANTOM_DATA, // functions + FN, + FN_MUT, FN_ONCE, FN_ONCE_OUTPUT, @@ -252,6 +254,14 @@ public: { return ItemType::PHANTOM_DATA; } + else if (item.compare ("fn") == 0) + { + return ItemType::FN; + } + else if (item.compare ("fn_mut") == 0) + { + return ItemType::FN_MUT; + } else if (item.compare ("fn_once") == 0) { return ItemType::FN_ONCE; @@ -462,6 +472,10 @@ public: return "RangeToInclusive"; case PHANTOM_DATA: return "phantom_data"; + case FN: + return "fn"; + case FN_MUT: + return "fn_mut"; case FN_ONCE: return "fn_once"; case FN_ONCE_OUTPUT: -- cgit v1.1