aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util/rust-lang-item.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/util/rust-lang-item.h')
-rw-r--r--gcc/rust/util/rust-lang-item.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index f947f3f..8f3af36 100644
--- a/gcc/rust/util/rust-lang-item.h
+++ b/gcc/rust/util/rust-lang-item.h
@@ -61,6 +61,7 @@ public:
DEREF,
DEREF_MUT,
+ RECEIVER,
// https://github.com/rust-lang/rust/blob/master/library/core/src/ops/index.rs
INDEX,
@@ -126,22 +127,46 @@ public:
OPTION_SOME,
OPTION_NONE,
+ RESULT_OK,
+ RESULT_ERR,
+
INTOITER_INTOITER,
ITERATOR_NEXT,
+
+ // NOTE: These lang items are *not* necessarily present in later versions of
+ // Rust (I am unsure at which point they have been removed as the `Try`
+ // trait is unstable). They will need to be changed when updating the
+ // targeted Rust version of gccrs
+ TRY,
+ TRY_INTO_RESULT,
+ TRY_FROM_ERROR,
+ TRY_FROM_OK,
+
+ // NOTE: This is not a lang item in later versions of Rust
+ FROM_FROM,
+
+ STRUCTURAL_PEQ,
+ STRUCTURAL_TEQ,
+
+ DISCRIMINANT_TYPE,
+ DISCRIMINANT_KIND,
};
static const BiMap<std::string, Kind> lang_items;
static tl::optional<Kind> Parse (const std::string &item);
+
static std::string ToString (Kind type);
static std::string PrettyString (Kind type);
+
static Kind OperatorToLangItem (ArithmeticOrLogicalOperator op);
static Kind
CompoundAssignmentOperatorToLangItem (ArithmeticOrLogicalOperator op);
static Kind NegationOperatorToLangItem (NegationOperator op);
static Kind ComparisonToLangItem (ComparisonOperator op);
-
static std::string ComparisonToSegment (ComparisonOperator op);
+
+ static bool IsEnumVariant (Kind type);
};
} // namespace Rust