about summary refs log tree commit diff
path: root/src/test/ui/array-slice-vec
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-26 15:48:10 +0000
committerbors <bors@rust-lang.org>2021-09-26 15:48:10 +0000
commitc09d6374324ee23cb5a4fe738f74369717dd642d (patch)
tree5cec1fb196fdc31a054a8dfaf0f87101d947b6a4 /src/test/ui/array-slice-vec
parentac8dd1b2f24dc62c962172b27433106b4e84dc62 (diff)
parent6550021124451628b1efc60c59284465b109e3aa (diff)
downloadrust-c09d6374324ee23cb5a4fe738f74369717dd642d.tar.gz
rust-c09d6374324ee23cb5a4fe738f74369717dd642d.zip
Auto merge of #88316 - est31:remove_box_tests, r=Mark-Simulacrum
Remove most box syntax uses from the testsuite except for src/test/ui/issues

Removes most box syntax uses from the testsuite outside of the src/test/ui/issues directory. The goal was to only change tests where box syntax is an implementation detail instead of the actual feature being tested. So some tests were left out, like the regression test for #87935, or tests where the obtained error message changed significantly.

Mostly this replaces box syntax with `Box::new`, but there are some minor drive by improvements, like formatting improvements or `assert_eq` instead of `assert!( == )`.

Prior PR that removed box syntax from the compiler and tools: #87781
Diffstat (limited to 'src/test/ui/array-slice-vec')
-rw-r--r--src/test/ui/array-slice-vec/vec-dst.rs6
-rw-r--r--src/test/ui/array-slice-vec/vector-no-ann-2.rs6
2 files changed, 5 insertions, 7 deletions
diff --git a/src/test/ui/array-slice-vec/vec-dst.rs b/src/test/ui/array-slice-vec/vec-dst.rs
index e741201652b..c58ddbc4239 100644
--- a/src/test/ui/array-slice-vec/vec-dst.rs
+++ b/src/test/ui/array-slice-vec/vec-dst.rs
@@ -1,11 +1,9 @@
 // run-pass
 
-#![feature(box_syntax)]
-
 pub fn main() {
-    // Tests for indexing into box/& [T; n]
+    // Tests for indexing into Box<[T; n]>/& [T; n]
     let x: [isize; 3] = [1, 2, 3];
-    let mut x: Box<[isize; 3]> = box x;
+    let mut x: Box<[isize; 3]> = x.into();
     assert_eq!(x[0], 1);
     assert_eq!(x[1], 2);
     assert_eq!(x[2], 3);
diff --git a/src/test/ui/array-slice-vec/vector-no-ann-2.rs b/src/test/ui/array-slice-vec/vector-no-ann-2.rs
index dd8f402f3f6..e2055f551ac 100644
--- a/src/test/ui/array-slice-vec/vector-no-ann-2.rs
+++ b/src/test/ui/array-slice-vec/vector-no-ann-2.rs
@@ -2,6 +2,6 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(box_syntax)]
-
-pub fn main() { let _quux: Box<Vec<usize>> = box Vec::new(); }
+pub fn main() {
+    let _quux: Box<Vec<usize>> = Box::new(Vec::new());
+}