diff --git a/.gitignore b/.gitignore index 8b3eece..ba80d38 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /owning_ref-0.3.3.crate +/owning_ref-0.4.0.crate diff --git a/owning_ref-pr43-fix-tests.patch b/owning_ref-pr43-fix-tests.patch deleted file mode 100644 index 604b775..0000000 --- a/owning_ref-pr43-fix-tests.patch +++ /dev/null @@ -1,51 +0,0 @@ -From f629c7b7db163a919cdd6a353c3318b1d66d5fad Mon Sep 17 00:00:00 2001 -From: Alexandre Bury -Date: Wed, 10 Jan 2018 15:29:34 +0100 -Subject: [PATCH] Fix tests - -Lifetime inference does not work here, we need to define the lifetimes. -But we can't do that with closures [1] so we use a function instead. - -[1]: https://github.com/rust-lang/rust/issues/22340 ---- - src/lib.rs | 18 ++++++++++++++++-- - 1 file changed, 16 insertions(+), 2 deletions(-) - -diff --git a/src/lib.rs b/src/lib.rs -index 21ed086..31dae97 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -1262,8 +1262,15 @@ mod tests { - let foo = [413, 612]; - let bar = &foo; - -+ // FIXME: lifetime inference fails us, and we can't easily define a lifetime for a closure -+ // (see https://github.com/rust-lang/rust/issues/22340) -+ // So we use a function to identify the lifetimes instead. -+ fn borrow<'a>(a: &'a &[i32; 2]) -> &'a i32 { -+ &a[0] -+ } -+ - let o: BoxRef<&[i32; 2]> = Box::new(bar).into(); -- let o: BoxRef<&[i32; 2], i32> = o.map(|a: &&[i32; 2]| &a[0]); -+ let o: BoxRef<&[i32; 2], i32> = o.map(borrow); - let o: BoxRef = o.erase_owner(); - - assert_eq!(*o, 413); -@@ -1693,8 +1700,15 @@ mod tests { - let mut foo = [413, 612]; - let bar = &mut foo; - -+ // FIXME: lifetime inference fails us, and we can't easily define a lifetime for a closure -+ // (see https://github.com/rust-lang/rust/issues/22340) -+ // So we use a function to identify the lifetimes instead. -+ fn borrow<'a>(a: &'a mut &mut [i32; 2]) -> &'a mut i32 { -+ &mut a[0] -+ } -+ - let o: BoxRefMut<&mut [i32; 2]> = Box::new(bar).into(); -- let o: BoxRefMut<&mut [i32; 2], i32> = o.map_mut(|a: &mut &mut [i32; 2]| &mut a[0]); -+ let o: BoxRefMut<&mut [i32; 2], i32> = o.map_mut(borrow); - let o: BoxRefMut = o.erase_owner(); - - assert_eq!(*o, 413); diff --git a/rust-owning_ref.spec b/rust-owning_ref.spec index 03f5fc9..028c2c8 100644 --- a/rust-owning_ref.spec +++ b/rust-owning_ref.spec @@ -6,16 +6,13 @@ %global crate owning_ref Name: rust-%{crate} -Version: 0.3.3 -Release: 7%{?dist} +Version: 0.4.0 +Release: 1%{?dist} Summary: Library for creating references that carry their owner with them License: MIT URL: https://crates.io/crates/owning_ref Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate -# https://github.com/Kimundi/owning-ref-rs/pull/43 -# see also https://github.com/rust-lang/rust/issues/47524 -Patch1: owning_ref-pr43-fix-tests.patch ExclusiveArch: %{rust_arches} @@ -69,6 +66,9 @@ which use "default" feature of "%{crate}" crate. %endif %changelog +* Sun Oct 28 2018 Igor Gnatenko - 0.4.0-1 +- Update to 0.4.0 + * Sat Oct 27 2018 Igor Gnatenko - 0.3.3-7 - Adapt to new packaging diff --git a/sources b/sources index 13edf62..91aa3ed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (owning_ref-0.3.3.crate) = 260f3d77f23b092c5ca96dff6746d378caa1bac965745a71ca18eed30a12c6869af62259daafc91c8666baf95e04619ad0d8fe06b47d5e517688b35f0c59005a +SHA512 (owning_ref-0.4.0.crate) = 51bb1cb259452f7395bce0ac4e7d2d6f3733dfe7a8a1a46d50179516ef921924f745a248e4816da5e434b589b5956a20ca554f9a93790b2ed1c55451b9b885ba