aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-05-19 02:11:36 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2024-06-11 11:19:26 +0000
commit36a21ef17c09dccc03d6d84a4f37b06b1b9cf716 (patch)
tree9bdbaaf012efa9040452b2f51c63bbe1a4f436e2
parentca178958c4bb599da331f62cc5cc8a480ea5371e (diff)
downloadgcc-36a21ef17c09dccc03d6d84a4f37b06b1b9cf716.zip
gcc-36a21ef17c09dccc03d6d84a4f37b06b1b9cf716.tar.gz
gcc-36a21ef17c09dccc03d6d84a4f37b06b1b9cf716.tar.bz2
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 <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/testsuite/rust/compile/box_syntax.rs6
-rw-r--r--gcc/testsuite/rust/compile/box_syntax_feature_gate.rs5
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/box_syntax.rs b/gcc/testsuite/rust/compile/box_syntax.rs
new file mode 100644
index 0000000..c63284b
--- /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 0000000..8eb5503
--- /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 *-*-* } }
+}