Skip to content
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
2 changes: 1 addition & 1 deletion crates/polars-arrow/src/array/binview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ impl<T: ViewType + ?Sized> BinaryViewArrayGeneric<T> {
}

pub fn is_sliced(&self) -> bool {
self.views.as_ptr() != self.views.storage_ptr()
!std::ptr::eq(self.views.as_ptr(), self.views.storage_ptr())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New lint

}

pub fn maybe_gc(self) -> Self {
Expand Down
4 changes: 3 additions & 1 deletion crates/polars-core/src/datatypes/dtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ impl PartialEq for DataType {
#[cfg(feature = "object")]
(Object(lhs), Object(rhs)) => lhs == rhs,
#[cfg(feature = "dtype-struct")]
(Struct(lhs), Struct(rhs)) => Vec::as_ptr(lhs) == Vec::as_ptr(rhs) || lhs == rhs,
(Struct(lhs), Struct(rhs)) => {
std::ptr::eq(Vec::as_ptr(lhs), Vec::as_ptr(rhs)) || lhs == rhs
},
#[cfg(feature = "dtype-array")]
(Array(left_inner, left_width), Array(right_inner, right_width)) => {
left_width == right_width && left_inner == right_inner
Expand Down
5 changes: 4 additions & 1 deletion crates/polars-expr/src/expressions/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ impl PhysicalExpr for FilterExpr {
let (mut ac_s, mut ac_predicate) = (ac_s?, ac_predicate?);
// Check if the groups are still equal, otherwise aggregate.
// TODO! create a special group iters that don't materialize
if ac_s.groups.as_ref() as *const _ != ac_predicate.groups.as_ref() as *const _ {
if !std::ptr::eq(
ac_s.groups.as_ref() as *const _,
ac_predicate.groups.as_ref() as *const _,
) {
let _ = ac_s.aggregated();
let _ = ac_predicate.aggregated();
}
Expand Down
7 changes: 4 additions & 3 deletions crates/polars-io/src/csv/read/read_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ impl<'a> CoreReader<'a> {
debug_assert!(count == 0 || b[position] == self.parse_options.eol_char);

let (b, count) = if count == 0
&& unsafe { b.as_ptr().add(b.len()) == bytes.as_ptr().add(bytes.len()) }
{
&& unsafe {
std::ptr::eq(b.as_ptr().add(b.len()), bytes.as_ptr().add(bytes.len()))
} {
total_offset = bytes.len();
(b, 1)
} else {
Expand Down Expand Up @@ -449,7 +450,7 @@ impl<'a> CoreReader<'a> {
// We cannot use the line count as there can be comments in the lines so we must correct line counts later.
if let Some(rc) = &slf.row_index {
// is first chunk
let offset = if b.as_ptr() == bytes.as_ptr() {
let offset = if std::ptr::eq(b.as_ptr(), bytes.as_ptr()) {
Some(rc.offset)
} else {
None
Expand Down
5 changes: 3 additions & 2 deletions crates/polars-plan/src/dsl/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ impl<T: PartialEq + Clone> PartialEq for LazySerde<T> {
use LazySerde as L;
match (self, other) {
(L::Deserialized(a), L::Deserialized(b)) => a == b,
(L::Bytes(a), L::Bytes(b)) => a.as_ptr() == b.as_ptr() && a.len() == b.len(),
(L::Bytes(a), L::Bytes(b)) => {
std::ptr::eq(a.as_ptr(), b.as_ptr()) && a.len() == b.len()
},
_ => false,
}
}
Expand Down Expand Up @@ -346,7 +348,6 @@ impl Default for Expr {

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

pub enum Excluded {
Name(PlSmallStr),
Dtype(DataType),
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-plan/src/plans/visitor/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ impl HashableEqLP<'_> {
schema: _,
output_schema: s_r,
},
) => Arc::as_ptr(dfl) == Arc::as_ptr(dfr) && s_l == s_r,
) => std::ptr::eq(Arc::as_ptr(dfl), Arc::as_ptr(dfr)) && s_l == s_r,
(
IR::SimpleProjection {
input: _,
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-python/src/interop/numpy/to_numpy_df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ where
let mut end_ptr = unsafe { first_slice.as_ptr().add(first_slice.len()) };
slices[1..].iter().all(|slice| {
let slice_ptr = slice.as_ptr();
let valid = slice_ptr == end_ptr;
let valid = std::ptr::eq(slice_ptr, end_ptr);

end_ptr = unsafe { slice_ptr.add(slice.len()) };

Expand Down
2 changes: 1 addition & 1 deletion crates/polars-utils/src/select.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(feature = "nightly")]
pub fn select_unpredictable<T>(cond: bool, true_val: T, false_val: T) -> T {
cond.select_unpredictable(true_val, false_val)
core::intrinsics::select_unpredictable(cond, true_val, false_val)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rustc complained that the method didn't exist anymore, so we call the intrinsic directly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this rust-lang/rust#139726.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeap. :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be core::hint, not core::intrinsics.

}

#[cfg(not(feature = "nightly"))]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2025-03-07"
channel = "nightly-2025-04-19"
Loading