From b0625dfd94571c773ee58d1242ba049b7ce44b6d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 7 May 2019 07:53:18 +0200 Subject: [PATCH] Add patch to work with new parking_lot Signed-off-by: Igor Gnatenko --- 0001-chore-Update-parking_lot-to-0.8.patch | 57 ++++++++++++++++++++++ rust-once_cell.spec | 2 + 2 files changed, 59 insertions(+) create mode 100644 0001-chore-Update-parking_lot-to-0.8.patch diff --git a/0001-chore-Update-parking_lot-to-0.8.patch b/0001-chore-Update-parking_lot-to-0.8.patch new file mode 100644 index 0000000..2ebf518 --- /dev/null +++ b/0001-chore-Update-parking_lot-to-0.8.patch @@ -0,0 +1,57 @@ +From 586a7e58b87d0f7418c798059c2e08e2e4bda26a Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Mon, 6 May 2019 15:30:58 +0200 +Subject: [PATCH] chore: Update parking_lot to 0.8 + +Signed-off-by: Igor Gnatenko +--- + src/imp_pl.rs | 6 +++--- + src/lib.rs | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/imp_pl.rs b/src/imp_pl.rs +index 8dbd853..c14ac4d 100644 +--- a/src/imp_pl.rs ++++ b/src/imp_pl.rs +@@ -1,7 +1,7 @@ + extern crate parking_lot; + + use std::cell::UnsafeCell; +-use self::parking_lot::{Once, ONCE_INIT, OnceState}; ++use self::parking_lot::{Once, OnceState}; + + /// A thread-safe cell which can be written to only once. + /// +@@ -55,14 +55,14 @@ impl PartialEq for OnceCell { + impl OnceCell { + /// An empty cell, for initialization in a `const` context. + pub const INIT: OnceCell = OnceCell { +- once: ONCE_INIT, ++ once: Once::new(), + value: UnsafeCell::new(None), + }; + + /// Creates a new empty cell. + pub fn new() -> OnceCell { + OnceCell { +- once: ONCE_INIT, ++ once: Once::new(), + value: UnsafeCell::new(None), + } + } +diff --git a/src/lib.rs b/src/lib.rs +index 3aef107..a5625aa 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -160,7 +160,7 @@ unifies the APIs of those crates. + To implement a sync flavor of `OnceCell`, this crates uses either `::std::sync::Once` or + `::parking_lot::Once`. This is controlled by the `parking_lot` feature, which is enabled by default. + +-When using `parking_lot`, the crate is compatible with rustc 1.25.0, without `parking_lot` a minimum ++When using `parking_lot`, the crate is compatible with rustc 1.31.0, without `parking_lot` a minimum + of `1.29.0` is required. + + This crate uses unsafe. +-- +2.21.0 + diff --git a/rust-once_cell.spec b/rust-once_cell.spec index ea6226f..7e59f3a 100644 --- a/rust-once_cell.spec +++ b/rust-once_cell.spec @@ -17,6 +17,8 @@ Source: %{crates_source} # * Exclude unnecessary files, https://github.com/matklad/once_cell/pull/12 # * Update parking_lot to 0.8, https://github.com/matklad/once_cell/pull/11 Patch0: once_cell-fix-metadata.diff +# Make it work with new parking_lot +Patch0001: 0001-chore-Update-parking_lot-to-0.8.patch ExclusiveArch: %{rust_arches}