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

Compile warning on rustc 1.86.0-nightly: function pointer comparisons do not produce meaningful results #536

Open
zirconium-n opened this issue Jan 6, 2025 · 1 comment

Comments

@zirconium-n
Copy link

zirconium-n commented Jan 6, 2025

warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
   --> capnp/src/introspect.rs:275:55
    |
275 |         core::ptr::eq(self.generic, other.generic) && self.field_types == other.field_types
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: the address of the same function can vary between different codegen units
    = note: furthermore, different functions could have the same address after being merged together
    = note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
    = note: `#[warn(unpredictable_function_pointer_comparisons)]` on by default

> rustc --version
rustc 1.86.0-nightly (b3b368a18 2025-01-05)
> git rev-parse HEAD
1ec4709b437ba247bc2bae02000535a03f494a33
@dwrensha
Copy link
Member

dwrensha commented Jan 6, 2025

Thanks for the report. I think this means that we need to remove the PartialEq and Eq impls in introspect.rs. I started a draft PR to do that: #537.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants