aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/util/rust-lang-item.cc3
-rw-r--r--gcc/rust/util/rust-lang-item.h3
-rw-r--r--gcc/testsuite/rust/compile/structural-eq-peq.rs9
3 files changed, 15 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-lang-item.cc b/gcc/rust/util/rust-lang-item.cc
index 091c6b6..9fcd325 100644
--- a/gcc/rust/util/rust-lang-item.cc
+++ b/gcc/rust/util/rust-lang-item.cc
@@ -112,6 +112,9 @@ const BiMap<std::string, LangItem::Kind> Rust::LangItem::lang_items = {{
{"from_ok", Kind::TRY_FROM_OK},
{"from", Kind::FROM_FROM},
+
+ {"structural_peq", Kind::STRUCTURAL_PEQ},
+ {"structural_teq", Kind::STRUCTURAL_TEQ},
}};
tl::optional<LangItem::Kind>
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index b5abf61..61d6454e 100644
--- a/gcc/rust/util/rust-lang-item.h
+++ b/gcc/rust/util/rust-lang-item.h
@@ -144,6 +144,9 @@ public:
// NOTE: This is not a lang item in later versions of Rust
FROM_FROM,
+
+ STRUCTURAL_PEQ,
+ STRUCTURAL_TEQ,
};
static const BiMap<std::string, Kind> lang_items;
diff --git a/gcc/testsuite/rust/compile/structural-eq-peq.rs b/gcc/testsuite/rust/compile/structural-eq-peq.rs
new file mode 100644
index 0000000..d04c295
--- /dev/null
+++ b/gcc/testsuite/rust/compile/structural-eq-peq.rs
@@ -0,0 +1,9 @@
+#[lang = "structural_peq"]
+pub trait StructuralPartialEq {
+ // Empty.
+}
+
+#[lang = "structural_teq"]
+pub trait StructuralEq {
+ // Empty.
+}