Skip to content

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Jun 7, 2025

The current code is not a problem with TB, the problem with SB is known and not caused by the one pointed by this lint and already has a PR to resolve it.

```
error: implicit autoref creates a reference to the dereference of a raw pointer
    --> crossbeam-skiplist/src/base.rs:2074:28
     |
2074 |                 let next = (*self.node).tower[0].load(Ordering::Relaxed, epoch::unprotected());
     |                            ^^---------^^^^^^^^^^
     |                              |
     |                              this raw pointer has type `*mut Node<K, V>`
     |
     = note: creating a reference requires the pointer target to be valid and imposes aliasing requirements
note: autoref is being applied to this expression, resulting in: `&Tower<K, V>`
    --> crossbeam-skiplist/src/base.rs:2074:28
     |
2074 |                 let next = (*self.node).tower[0].load(Ordering::Relaxed, epoch::unprotected());
     |                            ^^^^^^^^^^^^^^^^^^
     = note: `-D dangerous-implicit-autorefs` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(dangerous_implicit_autorefs)]`
help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
     |
2074 |                 let next = (&(*self.node).tower)[0].load(Ordering::Relaxed, epoch::unprotected());
     |                            ++                  +

error: implicit autoref creates a reference to the dereference of a raw pointer
    --> crossbeam-skiplist/src/base.rs:2105:28
     |
2105 |                 let next = (*self.node).tower[0].load(Ordering::Relaxed, epoch::unprotected());
     |                            ^^---------^^^^^^^^^^
     |                              |
     |                              this raw pointer has type `*mut Node<K, V>`
     |
     = note: creating a reference requires the pointer target to be valid and imposes aliasing requirements
note: autoref is being applied to this expression, resulting in: `&Tower<K, V>`
    --> crossbeam-skiplist/src/base.rs:2105:28
     |
2105 |                 let next = (*self.node).tower[0].load(Ordering::Relaxed, epoch::unprotected());
     |                            ^^^^^^^^^^^^^^^^^^
help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
     |
2105 |                 let next = (&(*self.node).tower)[0].load(Ordering::Relaxed, epoch::unprotected());
     |                            ++                  +
```
```
error: use `core::ptr::eq` when comparing raw pointers
   --> crossbeam-epoch/src/sync/list.rs:343:17
    |
343 |         assert!(maybe_e3.unwrap().unwrap() as *const Entry == e3.as_raw());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(maybe_e3.unwrap().unwrap(), e3.as_raw())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
    = note: `-D clippy::ptr-eq` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::ptr_eq)]`

error: use `core::ptr::eq` when comparing raw pointers
   --> crossbeam-epoch/src/sync/list.rs:346:17
    |
346 |         assert!(maybe_e2.unwrap().unwrap() as *const Entry == e2.as_raw());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(maybe_e2.unwrap().unwrap(), e2.as_raw())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq

error: use `core::ptr::eq` when comparing raw pointers
   --> crossbeam-epoch/src/sync/list.rs:349:17
    |
349 |         assert!(maybe_e1.unwrap().unwrap() as *const Entry == e1.as_raw());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(maybe_e1.unwrap().unwrap(), e1.as_raw())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq

error: use `core::ptr::eq` when comparing raw pointers
   --> crossbeam-epoch/src/sync/list.rs:382:17
    |
382 |         assert!(maybe_e3.unwrap().unwrap() as *const Entry == e3.as_raw());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(maybe_e3.unwrap().unwrap(), e3.as_raw())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq

error: use `core::ptr::eq` when comparing raw pointers
   --> crossbeam-epoch/src/sync/list.rs:385:17
    |
385 |         assert!(maybe_e1.unwrap().unwrap() as *const Entry == e1.as_raw());
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::eq(maybe_e1.unwrap().unwrap(), e1.as_raw())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq
```
@0xllx0
Copy link

0xllx0 commented Oct 6, 2025

Looks like there needs to be a MSRV bump to 1.74, also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants