Fix builds with Rust 1.73+ caused by ambiguous <number>::div_ceil calls

epel9
Fabio Valentini 1 year ago
parent 467463d061
commit ef36893637
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF

@ -0,0 +1,25 @@
From f7f8d914d12ded4528fe4367854fbd939742f3a1 Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Mon, 9 Oct 2023 00:48:38 +0200
Subject: [PATCH] Disambiguate num::Integer::div_ceil from <number>::div_ceil
---
src/anon_area.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/anon_area.rs b/src/anon_area.rs
index cb37b78..d9d9b6d 100644
--- a/src/anon_area.rs
+++ b/src/anon_area.rs
@@ -61,7 +61,7 @@ impl AnonArea {
pub fn resize(&mut self, mut size: usize) {
size = size.max(Self::UNIT_SIZE);
- let nr = size.div_ceil(&Self::UNIT_SIZE);
+ let nr = Integer::div_ceil(&size, &Self::UNIT_SIZE);
self.units.truncate(nr);
self.units.reserve(nr);
--
2.41.0

@ -1,5 +1,5 @@
--- rd-util-2.1.2/Cargo.toml 1970-01-01T00:00:01+00:00
+++ rd-util-2.1.2/Cargo.toml 2023-08-07T21:51:54.786572+00:00
+++ rd-util-2.1.2/Cargo.toml 2023-10-08T22:46:55.903717+00:00
@@ -87,7 +87,7 @@
version = "^1.0"

@ -1,4 +1,4 @@
# Generated by rust2rpm 24
# Generated by rust2rpm 25
%bcond_without check
%global debug_package %{nil}
@ -16,8 +16,10 @@ Source: %{crates_source}
# * bump simplelog dependency from 0.10 to 0.11:
# https://github.com/facebookexperimental/resctl-demo/pull/262
Patch: rd-util-fix-metadata.diff
# * fix builds with Rust 1.73+ caused by ambiguous <number>::div_ceil calls
Patch: 0001-Disambiguate-num-Integer-div_ceil-from-number-div_ce.patch
BuildRequires: rust-packaging >= 21
BuildRequires: cargo-rpm-macros >= 24
%global _description %{expand:
Utility collection library for resctl-demo.}
@ -51,7 +53,7 @@ use the "default" 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

Loading…
Cancel
Save