https://gcc.gnu.org/g:bb555badd4eb5d71af45f1056c8e45ad287e70ba

commit r15-8149-gbb555badd4eb5d71af45f1056c8e45ad287e70ba
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Sun May 19 02:11:36 2024 +0200

    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 <pierre-emmanuel.pa...@embecosm.com>

Diff:
---
 gcc/testsuite/rust/compile/box_syntax.rs              | 6 ++++++
 gcc/testsuite/rust/compile/box_syntax_feature_gate.rs | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/gcc/testsuite/rust/compile/box_syntax.rs 
b/gcc/testsuite/rust/compile/box_syntax.rs
new file mode 100644
index 000000000000..c63284b5163d
--- /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 000000000000..8eb5503dde6c
--- /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 *-*-* }  }
+}

Reply via email to