From: Philip Herron Date: Thu, 26 Sep 2024 14:25:21 +0000 (+0100) Subject: gccrs: add test case to show impl block on ! works X-Git-Tag: basepoints/gcc-16~1133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e416545361ab39fcced3b2c153a93887615fd64;p=thirdparty%2Fgcc.git 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 --- 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