From: Harishankar <[email protected]>

Fixes Rust-GCC/gccrs#3931
gcc/testsuite/ChangeLog:

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

Signed-off-by: Harishankar <[email protected]>
---
 gcc/testsuite/rust/compile/issue-3931.rs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/issue-3931.rs

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
-- 
2.50.1

Reply via email to