Skip to content

Commit

Permalink
Add new test for box syntax
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
P-E-P committed Jun 11, 2024
1 parent ca17895 commit 36a21ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcc/testsuite/rust/compile/box_syntax.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// { dg-options "-fsyntax-only" }
#![feature(box_syntax)]

fn main() {
let x: Box<_> = box 1;
}
5 changes: 5 additions & 0 deletions gcc/testsuite/rust/compile/box_syntax_feature_gate.rs
Original file line number Diff line number Diff line change
@@ -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 *-*-* } }
}

0 comments on commit 36a21ef

Please sign in to comment.