From 04702c2dcd17a38e334be66345bb6f56187b6e31 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 7 Sep 2018 15:44:39 -0700 Subject: [PATCH] Fix a const_err FTBFS --- ...err-on-test-offset_index_out_of_boun.patch | 27 +++++++++++++++++++ rust-memoffset.spec | 8 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-Add-allow-const_err-on-test-offset_index_out_of_boun.patch diff --git a/0001-Add-allow-const_err-on-test-offset_index_out_of_boun.patch b/0001-Add-allow-const_err-on-test-offset_index_out_of_boun.patch new file mode 100644 index 0000000..2a00c44 --- /dev/null +++ b/0001-Add-allow-const_err-on-test-offset_index_out_of_boun.patch @@ -0,0 +1,27 @@ +From 0437fd69c1de4c1f97d8cf449e6d510168cb8838 Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Fri, 7 Sep 2018 15:40:11 -0700 +Subject: [PATCH] Add #[allow(const_err)] on test offset_index_out_of_bounds + +The compiler now raises a deny-by-default `const_err` lint on this test, +which doesn't let it get to the expected `#[should_panic]`. We can +allow that lint in order to let the test hit the error it wants. +--- + src/offset_of.rs | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/offset_of.rs b/src/offset_of.rs +index 61486577b061..1c981c288a2e 100644 +--- a/src/offset_of.rs ++++ b/src/offset_of.rs +@@ -105,6 +105,7 @@ mod tests { + + #[test] + #[should_panic] ++ #[allow(const_err)] + fn offset_index_out_of_bounds() { + offset_of!(Foo, b[4]); + } +-- +2.17.1 + diff --git a/rust-memoffset.spec b/rust-memoffset.spec index a3dbc62..d485405 100644 --- a/rust-memoffset.spec +++ b/rust-memoffset.spec @@ -6,13 +6,16 @@ Name: rust-%{crate} Version: 0.2.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: C-like offset_of functionality for Rust structs. License: MIT URL: https://crates.io/crates/memoffset Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# https://github.com/Gilnaa/memoffset/pull/3 +Patch1: 0001-Add-allow-const_err-on-test-offset_index_out_of_boun.patch + ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging @@ -51,6 +54,9 @@ which use %{crate} from crates.io. %{cargo_registry}/%{crate}-%{version}/ %changelog +* Fri Sep 07 2018 Josh Stone - 0.2.1-3 +- Fix a const_err FTBFS + * Sat Jul 14 2018 Fedora Release Engineering - 0.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild