diff options
| author | bors <bors@rust-lang.org> | 2023-08-26 06:09:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-08-26 06:09:32 +0000 |
| commit | adb16d5ebd576188e5a4d49f3597e32acbf90e00 (patch) | |
| tree | 55a62521a94bc3399a3d755f55435826392439d1 /compiler/rustc_data_structures/src/sync | |
| parent | 0154f6c8108156d4835823d123d394abbf2ea741 (diff) | |
| parent | ec91a2361ba0de6aa90f92fe620d49ef84b177ef (diff) | |
| download | rust-adb16d5ebd576188e5a4d49f3597e32acbf90e00.tar.gz rust-adb16d5ebd576188e5a4d49f3597e32acbf90e00.zip | |
Auto merge of #3038 - rust-lang:rustup-2023-08-26, r=RalfJung
Automatic sync from rustc
Diffstat (limited to 'compiler/rustc_data_structures/src/sync')
| -rw-r--r-- | compiler/rustc_data_structures/src/sync/worker_local.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/sync/worker_local.rs b/compiler/rustc_data_structures/src/sync/worker_local.rs index 8c84daf4f16..27d687c3cfe 100644 --- a/compiler/rustc_data_structures/src/sync/worker_local.rs +++ b/compiler/rustc_data_structures/src/sync/worker_local.rs @@ -171,3 +171,9 @@ impl<T> Deref for WorkerLocal<T> { unsafe { &self.locals.get_unchecked(self.registry.id().verify()).0 } } } + +impl<T: Default> Default for WorkerLocal<T> { + fn default() -> Self { + WorkerLocal::new(|_| T::default()) + } +} |
