public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Handle "fn" and "fn_mut" lang items
@ 2023-04-06 21:35 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-06 21:35 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:011eb78b3531b27fd68aa89a50860564f44f8319
commit 011eb78b3531b27fd68aa89a50860564f44f8319
Author: Owen Avery <powerboat9.gamer@gmail.com>
Date: Mon Apr 3 18:52:23 2023 -0400
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 <powerboat9.gamer@gmail.com>
Diff:
---
gcc/rust/util/rust-lang-item.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index cc069e1a309..c3a63db6329 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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-06 21:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 21:35 [gcc/devel/rust/master] Handle "fn" and "fn_mut" lang items Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).