diff options
| author | clubby789 <jamie@hill-daniel.co.uk> | 2023-02-27 13:17:29 +0000 |
|---|---|---|
| committer | clubby789 <jamie@hill-daniel.co.uk> | 2023-03-12 13:19:46 +0000 |
| commit | 0932452fa40178b6f8b93a2bab3b4ead4e2bb560 (patch) | |
| tree | 640a6f9236a494096b535bffd7bbb30f1f62318e /tests | |
| parent | dd7df04e168324fc002ab4985b6c7513f08ccf49 (diff) | |
Remove `box_syntax` from AST and use in tools
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-box-expr.rs | 14 | ||||
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-box-expr.stderr | 12 | ||||
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-box_syntax.rs | 6 | ||||
| -rw-r--r-- | tests/ui/feature-gates/feature-gate-box_syntax.stderr | 12 | ||||
| -rw-r--r-- | tests/ui/parser/removed-syntax-box.rs | 10 | ||||
| -rw-r--r-- | tests/ui/parser/removed-syntax-box.stderr | 8 |
6 files changed, 18 insertions, 44 deletions
diff --git a/tests/ui/feature-gates/feature-gate-box-expr.rs b/tests/ui/feature-gates/feature-gate-box-expr.rs deleted file mode 100644 index 870253d2f05..00000000000 --- a/tests/ui/feature-gates/feature-gate-box-expr.rs +++ /dev/null @@ -1,14 +0,0 @@ -// gate-test-box_syntax - -// Check that `box EXPR` is feature-gated. -// -// See also feature-gate-placement-expr.rs -// -// (Note that the two tests are separated since the checks appear to -// be performed at distinct phases, with an abort_if_errors call -// separating them.) - -fn main() { - let x = box 'c'; //~ ERROR box expression syntax is experimental - println!("x: {}", x); -} diff --git a/tests/ui/feature-gates/feature-gate-box-expr.stderr b/tests/ui/feature-gates/feature-gate-box-expr.stderr deleted file mode 100644 index af864b25f14..00000000000 --- a/tests/ui/feature-gates/feature-gate-box-expr.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: box expression syntax is experimental; you can call `Box::new` instead - --> $DIR/feature-gate-box-expr.rs:12:13 - | -LL | let x = box 'c'; - | ^^^^^^^ - | - = note: see issue #49733 <https://github.com/rust-lang/rust/issues/49733> for more information - = help: add `#![feature(box_syntax)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-box_syntax.rs b/tests/ui/feature-gates/feature-gate-box_syntax.rs deleted file mode 100644 index 778660cc0b5..00000000000 --- a/tests/ui/feature-gates/feature-gate-box_syntax.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Test that the use of the box syntax is gated by `box_syntax` feature gate. - -fn main() { - let x = box 3; - //~^ ERROR box expression syntax is experimental; you can call `Box::new` instead -} diff --git a/tests/ui/feature-gates/feature-gate-box_syntax.stderr b/tests/ui/feature-gates/feature-gate-box_syntax.stderr deleted file mode 100644 index dcf8eeed7cf..00000000000 --- a/tests/ui/feature-gates/feature-gate-box_syntax.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: box expression syntax is experimental; you can call `Box::new` instead - --> $DIR/feature-gate-box_syntax.rs:4:13 - | -LL | let x = box 3; - | ^^^^^ - | - = note: see issue #49733 <https://github.com/rust-lang/rust/issues/49733> for more information - = help: add `#![feature(box_syntax)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/parser/removed-syntax-box.rs b/tests/ui/parser/removed-syntax-box.rs new file mode 100644 index 00000000000..b0e8eb0410e --- /dev/null +++ b/tests/ui/parser/removed-syntax-box.rs @@ -0,0 +1,10 @@ +fn main() { + struct T { + a: u8, + b: u8, + } + let _ = box () //~ ERROR expected expression, found reserved keyword `box` + let _ = box 1; + let _ = box T { a: 12, b: 18 }; + let _ = box [5; 30]; +} diff --git a/tests/ui/parser/removed-syntax-box.stderr b/tests/ui/parser/removed-syntax-box.stderr new file mode 100644 index 00000000000..8c8d5b3c4cb --- /dev/null +++ b/tests/ui/parser/removed-syntax-box.stderr @@ -0,0 +1,8 @@ +error: expected expression, found reserved keyword `box` + --> $DIR/removed-syntax-box.rs:6:13 + | +LL | let _ = box () + | ^^^ expected expression + +error: aborting due to previous error + |
