diff options
| author | joboet <jonasboettiger@icloud.com> | 2023-01-17 14:08:35 +0100 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2023-01-17 14:08:35 +0100 |
| commit | 7f2cf191917e4e562ee49ab51a324714bbb36412 (patch) | |
| tree | dc6c77007e0d62c308d1f16542d04eef917d97ed /library/std/src/thread | |
| parent | 159ba8a92c9e2fa4121f106176309521f4af87e9 (diff) | |
| download | rust-7f2cf191917e4e562ee49ab51a324714bbb36412.tar.gz rust-7f2cf191917e4e562ee49ab51a324714bbb36412.zip | |
refactor[std]: do not use box syntax
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/local.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index b30bb7b77ef..cf7c2e05a2e 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -1110,8 +1110,7 @@ pub mod os { let ptr = if ptr.is_null() { // If the lookup returned null, we haven't initialized our own // local copy, so do that now. - let ptr: Box<Value<T>> = box Value { inner: LazyKeyInner::new(), key: self }; - let ptr = Box::into_raw(ptr); + let ptr = Box::into_raw(Box::new(Value { inner: LazyKeyInner::new(), key: self })); // SAFETY: At this point we are sure there is no value inside // ptr so setting it will not affect anyone else. unsafe { |
