From 0dd939f93538da51aee3a2c1f4054d52e8a22170 Mon Sep 17 00:00:00 2001 From: Zhuchengyu04 Date: Tue, 9 Mar 2021 19:20:11 +0800 Subject: [PATCH 1/2] fix an error which is displayed in benchmark --- src/uint.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uint.rs b/src/uint.rs index 0317e794..6a3a9239 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -50,7 +50,7 @@ macro_rules! u_types { fn as_mpz(&self) -> mpz_t { mpz_t { size: self.size as i32, - d: self.data(), + d: std::ptr::NonNull::new((self.data())).unwrap(), alloc: $size, } } @@ -533,7 +533,7 @@ fn i32_to_mpz(i: i32, data: &mut u64) -> mpz_t { *data = i.abs() as u64; mpz_t { size: i.signum(), - d: mut_ptr(&data), + d: std::ptr::NonNull::new(data).unwrap() , alloc: 1, } } From d2937dfb171369e5b3ccd818c3f289ce8ab8e2b7 Mon Sep 17 00:00:00 2001 From: Zhuchengyu04 Date: Wed, 10 Mar 2021 10:41:46 +0800 Subject: [PATCH 2/2] fix an error which is displayed in benchmark --- src/uint.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uint.rs b/src/uint.rs index 6a3a9239..47033ba2 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -16,6 +16,7 @@ use std::cmp::{min, Ord, Ordering, PartialOrd}; use std::convert::From; use std::mem::transmute; use std::ops; +use std::ptr; macro_rules! u_types { ($($t:ident,$size:expr),+) => {