Update to version 1.10.1; Fixes RHBZ#2241488

epel9
Fabio Valentini 1 year ago
parent 7041b41c2c
commit d8fc05aa49
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

1
.gitignore vendored

@ -44,3 +44,4 @@
/regex-1.9.1.crate
/regex-1.9.4.crate
/regex-1.9.5.crate
/regex-1.10.1.crate

@ -0,0 +1,59 @@
From 8531cfcaf8baf9ac54c3faf2e5746ced7dcac0af Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Sun, 15 Oct 2023 01:52:14 +0200
Subject: [PATCH] regex: fix compilation of doctests on 32-bit architectures
---
src/regex/bytes.rs | 4 +++-
src/regex/string.rs | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/regex/bytes.rs b/src/regex/bytes.rs
index c742b09..19f5701 100644
--- a/src/regex/bytes.rs
+++ b/src/regex/bytes.rs
@@ -2025,7 +2025,6 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
/// This example shows how to create and use `CaptureLocations` in a search.
///
/// ```
-/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::bytes::Regex;
///
/// let re = Regex::new(r"(?<first>\w+)\s+(?<last>\w+)").unwrap();
@@ -2038,7 +2037,10 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
///
/// // Asking for an invalid capture group always returns None.
/// assert_eq!(None, locs.get(3));
+/// # // literals are too big for 32-bit usize: #1041
+/// # #[cfg(target_pointer_width = "64")]
/// assert_eq!(None, locs.get(34973498648));
+/// # #[cfg(target_pointer_width = "64")]
/// assert_eq!(None, locs.get(9944060567225171988));
/// ```
#[derive(Clone, Debug)]
diff --git a/src/regex/string.rs b/src/regex/string.rs
index 177a2af..880d608 100644
--- a/src/regex/string.rs
+++ b/src/regex/string.rs
@@ -2028,7 +2028,6 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
/// This example shows how to create and use `CaptureLocations` in a search.
///
/// ```
-/// # if !cfg!(target_pointer_width = "64") { return; } // see #1041
/// use regex::Regex;
///
/// let re = Regex::new(r"(?<first>\w+)\s+(?<last>\w+)").unwrap();
@@ -2041,7 +2040,10 @@ impl<'h, 'n> core::ops::Index<&'n str> for Captures<'h> {
///
/// // Asking for an invalid capture group always returns None.
/// assert_eq!(None, locs.get(3));
+/// # // literals are too big for 32-bit usize: #1041
+/// # #[cfg(target_pointer_width = "64")]
/// assert_eq!(None, locs.get(34973498648));
+/// # #[cfg(target_pointer_width = "64")]
/// assert_eq!(None, locs.get(9944060567225171988));
/// ```
#[derive(Clone, Debug)]
--
2.41.0

@ -1,17 +1,18 @@
# Generated by rust2rpm 24
# Generated by rust2rpm 25
%bcond_without check
%global debug_package %{nil}
%global crate regex
Name: rust-regex
Version: 1.9.5
Version: 1.10.1
Release: %autorelease
Summary: Implementation of regular expressions for Rust
License: MIT OR Apache-2.0
URL: https://crates.io/crates/regex
Source: %{crates_source}
Patch: 0001-regex-fix-compilation-of-doctests-on-32-bit-architec.patch
BuildRequires: cargo-rpm-macros >= 24
@ -34,7 +35,6 @@ use the "%{crate}" crate.
%license %{crate_instdir}/LICENSE-APACHE
%license %{crate_instdir}/LICENSE-MIT
%doc %{crate_instdir}/CHANGELOG.md
%doc %{crate_instdir}/HACKING.md
%doc %{crate_instdir}/README.md
%doc %{crate_instdir}/UNICODE.md
%{crate_instdir}/
@ -304,7 +304,7 @@ use the "use_std" feature of the "%{crate}" crate.
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
%generate_buildrequires
@ -318,14 +318,8 @@ use the "use_std" feature of the "%{crate}" crate.
%if %{with check}
%check
%ifarch %{ix86}
# * ignore harmless test failures on 32-bit architectures:
# https://github.com/rust-lang/regex/issues/1041
%cargo_test -- -- --skip builders::bytes::RegexBuilder::size_limit --skip builders::bytes::RegexSetBuilder::size_limit --skip builders::string::RegexBuilder::size_limit --skip builders::string::RegexSetBuilder::size_limit --skip regex::bytes::CaptureLocations --skip regex::string::CaptureLocations
%else
%cargo_test
%endif
%endif
%changelog
%autochangelog

@ -1 +1 @@
SHA512 (regex-1.9.5.crate) = 79b921edc977dc98bd07e89dc17873c8a1088473ddf941504973259bb8c46ad11bbe3818fb88a7ed07b86841206c322a9555033d0a5dfebb18fcae45e07ea53e
SHA512 (regex-1.10.1.crate) = cb31447c570b52bd0a1f49ac58903ae1d230162167615163a4940c48f3476369d86e7716cce827ffc7c76a4fd8a179061390d48b86163a25f257efd01dee570a

Loading…
Cancel
Save