aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-10-26 15:48:52 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:13:11 +0100
commit59bd1fc1a4453792aec4314df03b16d784bfcfbd (patch)
tree6b19ae357df9942865b04feba6199ab6152dbc1c
parent222f27d3ac159f1c56b670f336fb515e84491df4 (diff)
downloadgcc-59bd1fc1a4453792aec4314df03b16d784bfcfbd.zip
gcc-59bd1fc1a4453792aec4314df03b16d784bfcfbd.tar.gz
gcc-59bd1fc1a4453792aec4314df03b16d784bfcfbd.tar.bz2
gccrs: 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.patry@embecosm.com>
-rw-r--r--gcc/testsuite/rust/compile/issue-2709.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-2709.rs b/gcc/testsuite/rust/compile/issue-2709.rs
new file mode 100644
index 0000000..42fe7af
--- /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 }
+}