Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove function pointer comparison in EventLoopGroup initialization (#…
…1287) Trying to run `clippy` with Rust 1.85 fails with the following error: ``` error: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique --> mountpoint-s3-crt/src/common/ref_count.rs:30:13 | 30 | assert!(callback.shutdown_callback_fn == Some(shutdown_callback)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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: `-D unpredictable-function-pointer-comparisons` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unpredictable_function_pointer_comparisons)]` ``` This change reworks the affected code by inlining the shutdown callback functions into `EventLoopGroup::new_default` (the only caller), which makes the assertion redundant. ### Does this change impact existing behavior? No changes. ### Does this change need a changelog entry? Does it require a version change? No. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). --------- Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
- Loading branch information