]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: testsuite:Add a testcase for setup_associated_types
authorHarishankar <harishankarpp7@gmail.com>
Wed, 11 Mar 2026 00:04:25 +0000 (05:34 +0530)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 14 Apr 2026 21:48:35 +0000 (23:48 +0200)
Fixes Rust-GCC/gccrs#3931
gcc/testsuite/ChangeLog:

* rust/compile/issue-3931.rs: New test.

Signed-off-by: Harishankar <harishankarpp7@gmail.com>
gcc/testsuite/rust/compile/issue-3931.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/issue-3931.rs b/gcc/testsuite/rust/compile/issue-3931.rs
new file mode 100644 (file)
index 0000000..27d535c
--- /dev/null
@@ -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