diff options
-rw-r--r-- | gcc/testsuite/rust/compile/box_syntax.rs | 6 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/box_syntax_feature_gate.rs | 5 |
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 *-*-* } } +} |