hawkw / mycelium

🍄 an alleged 'operating system'
https://mycelium.elizas.website
MIT License
548 stars 20 forks source link

Address lint ambiguous_wide_pointer_comparisons #478

Open jamesmunns opened 4 months ago

jamesmunns commented 4 months ago

Noticed this warning:

warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> /Users/james/personal/mycelium/cordyceps/src/list.rs:497:12
    |
497 |         if head == tail {
    |            ^^^^^^^^^^^^
    |
    = note: `#[warn(ambiguous_wide_pointer_comparisons)]` on by default
help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
497 |         if std::ptr::addr_eq(head.as_ptr(), tail.as_ptr()) {
    |            ++++++++++++++++++    ~~~~~~~~~~     ++++++++++
help: use explicit `std::ptr::eq` method to compare metadata and addresses
    |
497 |         if std::ptr::eq(head.as_ptr(), tail.as_ptr()) {
    |            +++++++++++++    ~~~~~~~~~~     ++++++++++

warning: ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
   --> /Users/james/personal/mycelium/cordyceps/src/list.rs:966:13
    |
966 |             splice_start == splice_end
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
help: use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
    |
966 |             std::ptr::addr_eq(splice_start.as_ptr(), splice_end.as_ptr())
    |             ++++++++++++++++++            ~~~~~~~~~~           ++++++++++
help: use explicit `std::ptr::eq` method to compare metadata and addresses
    |
966 |             std::ptr::eq(splice_start.as_ptr(), splice_end.as_ptr())
    |             +++++++++++++            ~~~~~~~~~~           ++++++++++
hawkw commented 4 months ago

Ugh, it looks like some of the maitake tests are not feature flagged correctly: https://github.com/hawkw/mycelium/actions/runs/9821097757/job/27116399920?pr=478

I can fix that separately...

jamesmunns commented 4 months ago

Updated MSRV of cordyceps, and all crates that I could see that depend on cordyceps.