[gcc r15-8420] gccrs: add test case to show impl block on ! works
Arthur Cohen
cohenarthur@gcc.gnu.org
Wed Mar 19 14:43:36 GMT 2025
https://gcc.gnu.org/g:5e416545361ab39fcced3b2c153a93887615fd64
commit r15-8420-g5e416545361ab39fcced3b2c153a93887615fd64
Author: Philip Herron <herron.philip@googlemail.com>
Date: Thu Sep 26 15:25:21 2024 +0100
gccrs: add test case to show impl block on ! works
The resolution with ! was fixed in: 09cfe530f9c this adds a
test case to show the other issue is also fixed.
Fixes #2951
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: nr2 is crashing here
* rust/compile/issue-2951.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diff:
---
gcc/testsuite/rust/compile/issue-2951.rs | 13 +++++++++++++
gcc/testsuite/rust/compile/nr2/exclude | 1 +
2 files changed, 14 insertions(+)
diff --git a/gcc/testsuite/rust/compile/issue-2951.rs b/gcc/testsuite/rust/compile/issue-2951.rs
new file mode 100644
index 000000000000..d30a3bf2adf1
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-2951.rs
@@ -0,0 +1,13 @@
+#[lang = "sized"]
+pub trait Sized {}
+
+#[lang = "clone"]
+pub trait Clone: Sized {
+ fn clone(&self) -> Self;
+}
+
+impl Clone for ! {
+ fn clone(&self) -> Self {
+ *self
+ }
+}
diff --git a/gcc/testsuite/rust/compile/nr2/exclude b/gcc/testsuite/rust/compile/nr2/exclude
index 50781e56b85e..c30af607edb4 100644
--- a/gcc/testsuite/rust/compile/nr2/exclude
+++ b/gcc/testsuite/rust/compile/nr2/exclude
@@ -253,3 +253,4 @@ issue-3139-1.rs
issue-3139-2.rs
issue-3139-3.rs
issue-3036.rs
+issue-2951.rs
More information about the Gcc-cvs
mailing list