https://gcc.gnu.org/g:2c862b96f1663d568e84643d58df0b6e4e320d91

commit 2c862b96f1663d568e84643d58df0b6e4e320d91
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Thu Oct 26 15:48:52 2023 +0200

    Add a new test for const without body
    
    This new regression test highlight the fixed behavior for 2709.
    
    gcc/testsuite/ChangeLog:
    
            * rust/compile/issue-2709.rs: New test.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>

Diff:
---
 gcc/testsuite/rust/compile/issue-2709.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/testsuite/rust/compile/issue-2709.rs 
b/gcc/testsuite/rust/compile/issue-2709.rs
new file mode 100644
index 000000000000..42fe7af230d9
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-2709.rs
@@ -0,0 +1,8 @@
+fn main() {}
+
+struct S;
+
+impl S {
+    const Y: u8;
+    // { dg-error "associated constant in .impl. without body" "" { target 
*-*-* } .-1 }
+}

Reply via email to