From: Harishankar Date: Wed, 11 Mar 2026 00:04:25 +0000 (+0530) Subject: gccrs: testsuite:Add a testcase for setup_associated_types X-Git-Tag: basepoints/gcc-17~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14890b06aedd26545bfa1f88fbf3892c6434aa3f;p=thirdparty%2Fgcc.git gccrs: testsuite:Add a testcase for setup_associated_types Fixes Rust-GCC/gccrs#3931 gcc/testsuite/ChangeLog: * rust/compile/issue-3931.rs: New test. Signed-off-by: Harishankar --- diff --git a/gcc/testsuite/rust/compile/issue-3931.rs b/gcc/testsuite/rust/compile/issue-3931.rs new file mode 100644 index 00000000000..27d535c1be9 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-3931.rs @@ -0,0 +1,16 @@ +#![feature(no_core)] +#![no_core] + +trait Foo { + fn foo(); +} + +impl Foo for [(); 1] { // { dg-error "missing foo in implementation of trait .Foo. " } + fn main() { // { dg-error "method .main. is not a member of trait .Foo." } + <[(); 0] as Foo>::foo() + } +} + +fn main() { + <[(); 0] as Foo>::foo() +} \ No newline at end of file