about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-05-30 14:33:48 +0200
committerGitHub <noreply@github.com>2022-05-30 14:33:48 +0200
commit0ed320bdb9dff0f26f682cd6c9ccd6bfbffe5df8 (patch)
treeb2aa9546006a30e5d1ae2c9dc1e03b1dc2df6340 /library/std/src/thread
parent5c780b98d10f48d6255cf2deb2643194b9221c02 (diff)
parentcdb8e64bc78400f9366db3b556bb01f470855f55 (diff)
Rollup merge of #97494 - est31:remove_box_alloc_tests, r=Dylan-DPC
Use Box::new() instead of box syntax in library tests

The tests inside `library/*` have no reason to use `box` syntax as they have 0 performance relevance. Therefore, we can safely remove them (instead of having to use alternatives like the one in #97293).
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/tests.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs
index 7386fe1c442..5b8309cf5d2 100644
--- a/library/std/src/thread/tests.rs
+++ b/library/std/src/thread/tests.rs
@@ -127,7 +127,7 @@ where
 {
     let (tx, rx) = channel();
 
-    let x: Box<_> = box 1;
+    let x: Box<_> = Box::new(1);
     let x_in_parent = (&*x) as *const i32 as usize;
 
     spawnfn(Box::new(move || {
@@ -219,7 +219,7 @@ fn test_try_panic_any_message_owned_str() {
 #[test]
 fn test_try_panic_any_message_any() {
     match thread::spawn(move || {
-        panic_any(box 413u16 as Box<dyn Any + Send>);
+        panic_any(Box::new(413u16) as Box<dyn Any + Send>);
     })
     .join()
     {