From: Pierre-Emmanuel Patry Date: Sun, 19 May 2024 00:11:36 +0000 (+0200) Subject: gccrs: Add new test for box syntax X-Git-Tag: basepoints/gcc-16~1404 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb555badd4eb5d71af45f1056c8e45ad287e70ba;p=thirdparty%2Fgcc.git gccrs: Add new test for box syntax Add a new test to prevent regressions on the box syntax as well as its feature gate. gcc/testsuite/ChangeLog: * rust/compile/box_syntax.rs: New test. * rust/compile/box_syntax_feature_gate.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/testsuite/rust/compile/box_syntax.rs b/gcc/testsuite/rust/compile/box_syntax.rs new file mode 100644 index 00000000000..c63284b5163 --- /dev/null +++ b/gcc/testsuite/rust/compile/box_syntax.rs @@ -0,0 +1,6 @@ +// { dg-options "-fsyntax-only" } +#![feature(box_syntax)] + +fn main() { + let x: Box<_> = box 1; +} diff --git a/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs new file mode 100644 index 00000000000..8eb5503dde6 --- /dev/null +++ b/gcc/testsuite/rust/compile/box_syntax_feature_gate.rs @@ -0,0 +1,5 @@ +// { dg-options "-frust-compile-until=lowering" } + +fn main() { + let x: Box<_> = box 1; //{ dg-error "box expression syntax is experimental." "" { target *-*-* } } +}