Skip to content

Commit 8e5eb02

Browse files
committed
Add an Default impl for Lock
1 parent 697d3be commit 8e5eb02

File tree

1 file changed

+7
-0
lines changed
  • src/librustc_data_structures

1 file changed

+7
-0
lines changed

src/librustc_data_structures/sync.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,13 @@ impl<T> Lock<T> {
333333
}
334334
}
335335

336+
impl<T: Default> Default for Lock<T> {
337+
#[inline]
338+
fn default() -> Self {
339+
Lock::new(T::default())
340+
}
341+
}
342+
336343
// FIXME: Probably a bad idea
337344
impl<T: Clone> Clone for Lock<T> {
338345
#[inline]

0 commit comments

Comments
 (0)