Skip to content

Commit

Permalink
build: Bump Rust toolchain to nightly-2024-10-28 (#19492)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Oct 28, 2024
1 parent 2879a2d commit b42ba05
Show file tree
Hide file tree
Showing 81 changed files with 328 additions and 351 deletions.
327 changes: 162 additions & 165 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions crates/polars-arrow/src/array/dictionary/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<'a, K: DictionaryKey> DictionaryValuesIter<'a, K> {
}
}

impl<'a, K: DictionaryKey> Iterator for DictionaryValuesIter<'a, K> {
impl<K: DictionaryKey> Iterator for DictionaryValuesIter<'_, K> {
type Item = Box<dyn Scalar>;

#[inline]
Expand All @@ -40,9 +40,9 @@ impl<'a, K: DictionaryKey> Iterator for DictionaryValuesIter<'a, K> {
}
}

unsafe impl<'a, K: DictionaryKey> TrustedLen for DictionaryValuesIter<'a, K> {}
unsafe impl<K: DictionaryKey> TrustedLen for DictionaryValuesIter<'_, K> {}

impl<'a, K: DictionaryKey> DoubleEndedIterator for DictionaryValuesIter<'a, K> {
impl<K: DictionaryKey> DoubleEndedIterator for DictionaryValuesIter<'_, K> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
if self.index == self.end {
Expand Down
10 changes: 4 additions & 6 deletions crates/polars-arrow/src/array/dictionary/typed_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,9 @@ impl<'a, K: DictionaryKey, V: DictValue> Iterator for DictionaryValuesIterTyped<
}
}

unsafe impl<'a, K: DictionaryKey, V: DictValue> TrustedLen for DictionaryValuesIterTyped<'a, K, V> {}
unsafe impl<K: DictionaryKey, V: DictValue> TrustedLen for DictionaryValuesIterTyped<'_, K, V> {}

impl<'a, K: DictionaryKey, V: DictValue> DoubleEndedIterator
for DictionaryValuesIterTyped<'a, K, V>
{
impl<K: DictionaryKey, V: DictValue> DoubleEndedIterator for DictionaryValuesIterTyped<'_, K, V> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
if self.index == self.end {
Expand Down Expand Up @@ -181,9 +179,9 @@ impl<'a, K: DictionaryKey, V: DictValue> Iterator for DictionaryIterTyped<'a, K,
}
}

unsafe impl<'a, K: DictionaryKey, V: DictValue> TrustedLen for DictionaryIterTyped<'a, K, V> {}
unsafe impl<K: DictionaryKey, V: DictValue> TrustedLen for DictionaryIterTyped<'_, K, V> {}

impl<'a, K: DictionaryKey, V: DictValue> DoubleEndedIterator for DictionaryIterTyped<'a, K, V> {
impl<K: DictionaryKey, V: DictValue> DoubleEndedIterator for DictionaryIterTyped<'_, K, V> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
if self.index == self.end {
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/array/growable/null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl GrowableNull {
}
}

impl<'a> Growable<'a> for GrowableNull {
impl Growable<'_> for GrowableNull {
unsafe fn extend(&mut self, _: usize, _: usize, len: usize) {
self.length += len;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/array/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<'a, A: ArrayAccessor<'a> + ?Sized> Iterator for NonNullValuesIter<'a, A> {

unsafe impl<'a, A: ArrayAccessor<'a> + ?Sized> TrustedLen for NonNullValuesIter<'a, A> {}

impl<'a, A: ?Sized> Clone for NonNullValuesIter<'a, A> {
impl<A: ?Sized> Clone for NonNullValuesIter<'_, A> {
fn clone(&self) -> Self {
Self {
accessor: self.accessor,
Expand Down
6 changes: 3 additions & 3 deletions crates/polars-arrow/src/array/map/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a> MapValuesIter<'a> {
}
}

impl<'a> Iterator for MapValuesIter<'a> {
impl Iterator for MapValuesIter<'_> {
type Item = Box<dyn Array>;

#[inline]
Expand All @@ -43,9 +43,9 @@ impl<'a> Iterator for MapValuesIter<'a> {
}
}

unsafe impl<'a> TrustedLen for MapValuesIter<'a> {}
unsafe impl TrustedLen for MapValuesIter<'_> {}

impl<'a> DoubleEndedIterator for MapValuesIter<'a> {
impl DoubleEndedIterator for MapValuesIter<'_> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
if self.index == self.end {
Expand Down
10 changes: 5 additions & 5 deletions crates/polars-arrow/src/array/static_array_collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ impl<T: TrivialIntoBytes> IntoBytes for T {
}
}
impl TrivialIntoBytes for Vec<u8> {}
impl<'a> TrivialIntoBytes for Cow<'a, [u8]> {}
impl<'a> TrivialIntoBytes for &'a [u8] {}
impl TrivialIntoBytes for Cow<'_, [u8]> {}
impl TrivialIntoBytes for &[u8] {}
impl TrivialIntoBytes for String {}
impl<'a> TrivialIntoBytes for &'a str {}
impl TrivialIntoBytes for &str {}
impl<'a> IntoBytes for Cow<'a, str> {
type AsRefT = Cow<'a, [u8]>;
fn into_bytes(self) -> Cow<'a, [u8]> {
Expand Down Expand Up @@ -590,8 +590,8 @@ unsafe fn into_utf8array(arr: BinaryArray<i64>) -> Utf8Array<i64> {

trait StrIntoBytes: IntoBytes {}
impl StrIntoBytes for String {}
impl<'a> StrIntoBytes for &'a str {}
impl<'a> StrIntoBytes for Cow<'a, str> {}
impl StrIntoBytes for &str {}
impl StrIntoBytes for Cow<'_, str> {}

impl<T: StrIntoBytes> ArrayFromIter<T> for Utf8ViewArray {
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions crates/polars-arrow/src/array/struct_/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'a> StructValueIter<'a> {
}
}

impl<'a> Iterator for StructValueIter<'a> {
impl Iterator for StructValueIter<'_> {
type Item = Vec<Box<dyn Scalar>>;

#[inline]
Expand Down Expand Up @@ -48,9 +48,9 @@ impl<'a> Iterator for StructValueIter<'a> {
}
}

unsafe impl<'a> TrustedLen for StructValueIter<'a> {}
unsafe impl TrustedLen for StructValueIter<'_> {}

impl<'a> DoubleEndedIterator for StructValueIter<'a> {
impl DoubleEndedIterator for StructValueIter<'_> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
if self.index == self.end {
Expand Down
6 changes: 3 additions & 3 deletions crates/polars-arrow/src/array/union/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'a> UnionIter<'a> {
}
}

impl<'a> Iterator for UnionIter<'a> {
impl Iterator for UnionIter<'_> {
type Item = Box<dyn Scalar>;

#[inline]
Expand Down Expand Up @@ -54,6 +54,6 @@ impl<'a> UnionArray {
}
}

impl<'a> std::iter::ExactSizeIterator for UnionIter<'a> {}
impl std::iter::ExactSizeIterator for UnionIter<'_> {}

unsafe impl<'a> TrustedLen for UnionIter<'a> {}
unsafe impl TrustedLen for UnionIter<'_> {}
6 changes: 3 additions & 3 deletions crates/polars-arrow/src/bitmap/bitmap_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,23 +338,23 @@ impl PartialEq for Bitmap {
}
}

impl<'a, 'b> BitOr<&'b Bitmap> for &'a Bitmap {
impl<'b> BitOr<&'b Bitmap> for &Bitmap {
type Output = Bitmap;

fn bitor(self, rhs: &'b Bitmap) -> Bitmap {
or(self, rhs)
}
}

impl<'a, 'b> BitAnd<&'b Bitmap> for &'a Bitmap {
impl<'b> BitAnd<&'b Bitmap> for &Bitmap {
type Output = Bitmap;

fn bitand(self, rhs: &'b Bitmap) -> Bitmap {
and(self, rhs)
}
}

impl<'a, 'b> BitXor<&'b Bitmap> for &'a Bitmap {
impl<'b> BitXor<&'b Bitmap> for &Bitmap {
type Output = Bitmap;

fn bitxor(self, rhs: &'b Bitmap) -> Bitmap {
Expand Down
16 changes: 8 additions & 8 deletions crates/polars-arrow/src/bitmap/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'a> TrueIdxIter<'a> {
}
}

impl<'a> Iterator for TrueIdxIter<'a> {
impl Iterator for TrueIdxIter<'_> {
type Item = usize;

#[inline]
Expand Down Expand Up @@ -93,7 +93,7 @@ impl<'a> Iterator for TrueIdxIter<'a> {
}
}

unsafe impl<'a> TrustedLen for TrueIdxIter<'a> {}
unsafe impl TrustedLen for TrueIdxIter<'_> {}

pub struct FastU32BitmapIter<'a> {
bytes: &'a [u8],
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<'a> FastU32BitmapIter<'a> {
}
}

impl<'a> Iterator for FastU32BitmapIter<'a> {
impl Iterator for FastU32BitmapIter<'_> {
type Item = u32;

#[inline]
Expand Down Expand Up @@ -171,7 +171,7 @@ impl<'a> Iterator for FastU32BitmapIter<'a> {
}
}

unsafe impl<'a> TrustedLen for FastU32BitmapIter<'a> {}
unsafe impl TrustedLen for FastU32BitmapIter<'_> {}

pub struct FastU56BitmapIter<'a> {
bytes: &'a [u8],
Expand Down Expand Up @@ -222,7 +222,7 @@ impl<'a> FastU56BitmapIter<'a> {
}
}

impl<'a> Iterator for FastU56BitmapIter<'a> {
impl Iterator for FastU56BitmapIter<'_> {
type Item = u64;

#[inline]
Expand Down Expand Up @@ -252,7 +252,7 @@ impl<'a> Iterator for FastU56BitmapIter<'a> {
}
}

unsafe impl<'a> TrustedLen for FastU56BitmapIter<'a> {}
unsafe impl TrustedLen for FastU56BitmapIter<'_> {}

pub struct FastU64BitmapIter<'a> {
bytes: &'a [u8],
Expand Down Expand Up @@ -317,7 +317,7 @@ impl<'a> FastU64BitmapIter<'a> {
}
}

impl<'a> Iterator for FastU64BitmapIter<'a> {
impl Iterator for FastU64BitmapIter<'_> {
type Item = u64;

#[inline]
Expand Down Expand Up @@ -349,7 +349,7 @@ impl<'a> Iterator for FastU64BitmapIter<'a> {
}
}

unsafe impl<'a> TrustedLen for FastU64BitmapIter<'a> {}
unsafe impl TrustedLen for FastU64BitmapIter<'_> {}

/// This crates' equivalent of [`std::vec::IntoIter`] for [`Bitmap`].
#[derive(Debug, Clone)]
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-arrow/src/bitmap/utils/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl<'a> BitmapIter<'a> {
}
}

impl<'a> Iterator for BitmapIter<'a> {
impl Iterator for BitmapIter<'_> {
type Item = bool;

#[inline]
Expand Down Expand Up @@ -238,7 +238,7 @@ impl<'a> Iterator for BitmapIter<'a> {
}
}

impl<'a> DoubleEndedIterator for BitmapIter<'a> {
impl DoubleEndedIterator for BitmapIter<'_> {
#[inline]
fn next_back(&mut self) -> Option<bool> {
if self.rest_len > 0 {
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/bitmap/utils/slice_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl<'a> SlicesIterator<'a> {
}
}

impl<'a> Iterator for SlicesIterator<'a> {
impl Iterator for SlicesIterator<'_> {
type Item = (usize, usize);

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/ffi/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ pub struct ArrowArrayChild<'a> {
parent: InternalArrowArray,
}

impl<'a> ArrowArrayRef for ArrowArrayChild<'a> {
impl ArrowArrayRef for ArrowArrayChild<'_> {
/// the dtype as declared in the schema
fn dtype(&self) -> &ArrowDataType {
&self.dtype
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/io/ipc/read/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<'a, A, I: Iterator<Item = A>> ProjectionIter<'a, A, I> {
}
}

impl<'a, A, I: Iterator<Item = A>> Iterator for ProjectionIter<'a, A, I> {
impl<A, I: Iterator<Item = A>> Iterator for ProjectionIter<'_, A, I> {
type Item = ProjectionResult<A>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down
6 changes: 2 additions & 4 deletions crates/polars-arrow/src/io/ipc/read/flight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub struct FlightStreamProducer<'a, R: AsyncRead + AsyncSeek + Unpin + Send> {
reader: &'a mut R,
}

impl<'a, R: AsyncRead + AsyncSeek + Unpin + Send> Drop for FlightStreamProducer<'a, R> {
impl<R: AsyncRead + AsyncSeek + Unpin + Send> Drop for FlightStreamProducer<'_, R> {
fn drop(&mut self) {
if let Some(p) = self.footer {
unsafe {
Expand All @@ -186,7 +186,7 @@ impl<'a, R: AsyncRead + AsyncSeek + Unpin + Send> Drop for FlightStreamProducer<
}
}

unsafe impl<'a, R: AsyncRead + AsyncSeek + Unpin + Send> Send for FlightStreamProducer<'a, R> {}
unsafe impl<R: AsyncRead + AsyncSeek + Unpin + Send> Send for FlightStreamProducer<'_, R> {}

impl<'a, R: AsyncRead + AsyncSeek + Unpin + Send> FlightStreamProducer<'a, R> {
pub async fn new(reader: &'a mut R) -> PolarsResult<Pin<Box<Self>>> {
Expand Down Expand Up @@ -414,7 +414,6 @@ mod test {
}

#[tokio::test]
#[allow(clippy::needless_return)]
async fn test_file_flight_simple() {
let path = &get_file_path();
let mut file = tokio::fs::File::open(path).await.unwrap();
Expand All @@ -427,7 +426,6 @@ mod test {
}

#[tokio::test]
#[allow(clippy::needless_return)]
async fn test_file_flight_amortized() {
let path = &get_file_path();
let mut file = File::open(path).await.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/io/ipc/write/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ pub struct Record<'a> {
fields: Option<Cow<'a, [IpcField]>>,
}

impl<'a> Record<'a> {
impl Record<'_> {
/// Get the IPC fields for this record.
pub fn fields(&self) -> Option<&[IpcField]> {
self.fields.as_deref()
Expand Down
4 changes: 2 additions & 2 deletions crates/polars-arrow/src/legacy/kernels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<'a> MaskedSlicesIterator<'a> {
}
}

impl<'a> Iterator for MaskedSlicesIterator<'a> {
impl Iterator for MaskedSlicesIterator<'_> {
type Item = (usize, usize);

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -209,7 +209,7 @@ impl<'a> BinaryMaskedSliceIterator<'a> {
}
}

impl<'a> Iterator for BinaryMaskedSliceIterator<'a> {
impl Iterator for BinaryMaskedSliceIterator<'_> {
type Item = (usize, usize, bool);

fn next(&mut self) -> Option<Self::Item> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct SortedMinMax<'a, T: NativeType> {
null_count: usize,
}

impl<'a, T: NativeType> SortedMinMax<'a, T> {
impl<T: NativeType> SortedMinMax<'_, T> {
fn count_nulls(&self, start: usize, end: usize) -> usize {
let (bytes, offset, _) = self.validity.as_slice();
count_zeros(bytes, offset + start, end - start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct SumWindow<'a, T> {
pub(super) null_count: usize,
}

impl<'a, T: NativeType + IsFloat + Add<Output = T> + Sub<Output = T>> SumWindow<'a, T> {
impl<T: NativeType + IsFloat + Add<Output = T> + Sub<Output = T>> SumWindow<'_, T> {
// compute sum from the entire window
unsafe fn compute_sum_and_null_count(&mut self, start: usize, end: usize) -> Option<T> {
let mut sum = None;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub(super) struct SumSquaredWindow<'a, T> {
null_count: usize,
}

impl<'a, T: NativeType + IsFloat + Add<Output = T> + Sub<Output = T> + Mul<Output = T>>
SumSquaredWindow<'a, T>
impl<T: NativeType + IsFloat + Add<Output = T> + Sub<Output = T> + Mul<Output = T>>
SumSquaredWindow<'_, T>
{
// compute sum from the entire window
unsafe fn compute_sum_and_null_count(&mut self, start: usize, end: usize) -> Option<T> {
Expand Down
Loading

0 comments on commit b42ba05

Please sign in to comment.