From 23ea9642dda0c8d8b65a79af37a59a02912f6171 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 16 Feb 2018 12:49:57 +0100 Subject: [PATCH] add patch to fix tests on i686 Signed-off-by: Igor Gnatenko --- 0001-Fix-failing-doctests-on-i686-64.patch | 53 ++++++++++++++++++++++ rust-crossbeam-epoch.spec | 2 + 2 files changed, 55 insertions(+) create mode 100644 0001-Fix-failing-doctests-on-i686-64.patch diff --git a/0001-Fix-failing-doctests-on-i686-64.patch b/0001-Fix-failing-doctests-on-i686-64.patch new file mode 100644 index 0000000..8b429d1 --- /dev/null +++ b/0001-Fix-failing-doctests-on-i686-64.patch @@ -0,0 +1,53 @@ +From 02c2c5953c1ab19db697cc6916f38d93d2550116 Mon Sep 17 00:00:00 2001 +From: Stjepan Glavina +Date: Fri, 16 Feb 2018 11:51:46 +0100 +Subject: [PATCH] Fix failing doctests on i686 (#64) + +--- + src/atomic.rs | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/atomic.rs b/src/atomic.rs +index 0677332..d5e9bd6 100644 +--- a/src/atomic.rs ++++ b/src/atomic.rs +@@ -681,8 +681,8 @@ impl Owned { + /// + /// let o = Owned::new(0u64); + /// assert_eq!(o.tag(), 0); +- /// let o = o.with_tag(5); +- /// assert_eq!(o.tag(), 5); ++ /// let o = o.with_tag(2); ++ /// assert_eq!(o.tag(), 2); + /// ``` + pub fn with_tag(self, tag: usize) -> Owned { + let data = self.into_data(); +@@ -985,10 +985,10 @@ impl<'g, T> Shared<'g, T> { + /// use crossbeam_epoch::{self as epoch, Atomic, Owned}; + /// use std::sync::atomic::Ordering::SeqCst; + /// +- /// let a = Atomic::::from(Owned::new(0u64).with_tag(5)); ++ /// let a = Atomic::::from(Owned::new(0u64).with_tag(2)); + /// let guard = &epoch::pin(); + /// let p = a.load(SeqCst, guard); +- /// assert_eq!(p.tag(), 5); ++ /// assert_eq!(p.tag(), 2); + /// ``` + pub fn tag(&self) -> usize { + let (_, tag) = decompose_data::(self.data); +@@ -1007,10 +1007,10 @@ impl<'g, T> Shared<'g, T> { + /// let a = Atomic::new(0u64); + /// let guard = &epoch::pin(); + /// let p1 = a.load(SeqCst, guard); +- /// let p2 = p1.with_tag(5); ++ /// let p2 = p1.with_tag(2); + /// + /// assert_eq!(p1.tag(), 0); +- /// assert_eq!(p2.tag(), 5); ++ /// assert_eq!(p2.tag(), 2); + /// assert_eq!(p1.as_raw(), p2.as_raw()); + /// ``` + pub fn with_tag(&self, tag: usize) -> Shared<'g, T> { +-- +2.16.1 + diff --git a/rust-crossbeam-epoch.spec b/rust-crossbeam-epoch.spec index 178980e..7b040cf 100644 --- a/rust-crossbeam-epoch.spec +++ b/rust-crossbeam-epoch.spec @@ -15,6 +15,8 @@ Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{ # Initial patched metadata # * Bump lazy_static to 1, rand to 0.4: https://github.com/crossbeam-rs/crossbeam-epoch/pull/62 Patch0: crossbeam-epoch-0.4.0-fix-metadata.diff +# https://github.com/crossbeam-rs/crossbeam-epoch/commit/02c2c5953c1ab19db697cc6916f38d93d2550116 +Patch0001: 0001-Fix-failing-doctests-on-i686-64.patch ExclusiveArch: %{rust_arches}