Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The minimum amount of work required to fix our CI #1388

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/arrayformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ impl FormatOptions
fn set_no_limit(mut self, no_limit: bool) -> Self
{
if no_limit {
self.axis_collapse_limit = std::usize::MAX;
self.axis_collapse_limit_next_last = std::usize::MAX;
self.axis_collapse_limit_last = std::usize::MAX;
self.axis_collapse_limit = usize::MAX;
self.axis_collapse_limit_next_last = usize::MAX;
self.axis_collapse_limit_last = usize::MAX;
}
self
}
Expand Down
2 changes: 1 addition & 1 deletion src/arraytraits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ where Slice: AsMut<[A]>
let xs = slice.as_mut();
if mem::size_of::<A>() == 0 {
assert!(
xs.len() <= ::std::isize::MAX as usize,
xs.len() <= isize::MAX as usize,
"Slice length must fit in `isize`.",
);
}
Expand Down
1 change: 1 addition & 0 deletions src/data_repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::mem;
use std::mem::ManuallyDrop;
use std::ptr::NonNull;

#[allow(unused_imports)]
use rawpointer::PointerExt;

/// Array's representation.
Expand Down
1 change: 1 addition & 0 deletions src/data_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

//! The data (inner representation) traits for ndarray

#[allow(unused_imports)]
use rawpointer::PointerExt;

use alloc::sync::Arc;
Expand Down
3 changes: 1 addition & 2 deletions src/dimension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub use self::remove_axis::RemoveAxis;
pub(crate) use self::axes::axes_of;
pub(crate) use self::reshape::reshape_dim;

use std::isize;
use std::mem;

#[macro_use]
Expand Down Expand Up @@ -94,7 +93,7 @@ pub fn size_of_shape_checked<D: Dimension>(dim: &D) -> Result<usize, ShapeError>
.filter(|&&d| d != 0)
.try_fold(1usize, |acc, &d| acc.checked_mul(d))
.ok_or_else(|| from_kind(ErrorKind::Overflow))?;
if size_nonzero > ::std::isize::MAX as usize {
if size_nonzero > isize::MAX as usize {
Err(from_kind(ErrorKind::Overflow))
} else {
Ok(dim.size())
Expand Down
1 change: 1 addition & 0 deletions src/impl_constructors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use crate::iterators::TrustedIterator;
use crate::StrideShape;
#[cfg(feature = "std")]
use crate::{geomspace, linspace, logspace};
#[allow(unused_imports)]
use rawpointer::PointerExt;

/// # Constructor Methods for Owned Arrays
Expand Down
1 change: 1 addition & 0 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use alloc::slice;
use alloc::vec;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
#[allow(unused_imports)]
use rawpointer::PointerExt;
use std::mem::{size_of, ManuallyDrop};

Expand Down
1 change: 1 addition & 0 deletions src/impl_owned_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use alloc::vec::Vec;
use std::mem;
use std::mem::MaybeUninit;

#[allow(unused_imports)]
use rawpointer::PointerExt;

use crate::imp_prelude::*;
Expand Down
1 change: 1 addition & 0 deletions src/impl_views/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// except according to those terms.

use alloc::slice;
#[allow(unused_imports)]
use rawpointer::PointerExt;
use std::mem::MaybeUninit;

Expand Down
2 changes: 1 addition & 1 deletion src/linalg/impl_linalg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ where
fn dot_shape_error(m: usize, k: usize, k2: usize, n: usize) -> !
{
match m.checked_mul(n) {
Some(len) if len <= ::std::isize::MAX as usize => {}
Some(len) if len <= isize::MAX as usize => {}
_ => panic!("ndarray: shape {} × {} overflows isize", m, n),
}
panic!(
Expand Down