You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(PartialEq)] // code fails to build if we remove this or replace it by a manual impl
@@ -100,7 +100,7 @@ Most of the values of primitive Rust types have structural equality (integers, `
100
100
101
101
- Pointer types (raw pointers and function pointers): these compare by test the memory address for equality.
102
102
It is unclear whether that should be considered "structural", but it is fairly clear that this should be considered a bad idea:
103
-
Rust makes basically no guarantees for when two function pointers are equal or inequal
103
+
Rust makes basically no guarantees for when two function pointers are equal or unequal
104
104
(the "same" function can be duplicated across codegen units and this have different addresses,
105
105
and different functions can be merged when they compile to the same assembly and thus have the same address).
106
106
Similarly, there are no or few guarantees for equality of pointers that are generated in constants.
@@ -189,7 +189,7 @@ This RFC breaks code that compiles today, but only code that already emits a fut
189
189
This only recently landed (Rust 1.75, currently in beta), and is not currently shown in dependencies.
190
190
Crater found [three cases](https://github.com/rust-lang/rust/pull/116930#issuecomment-1784648989) across the ecosystem where `match` was used to compare function pointers;
191
191
that code is buggy for the reasons mentioned above that make comparing function pointers unreliable.
192
-
- Matching on floats triggers illegal_floating_point_literal_pattern`. This triggers on *all* float matches, not juts the forbidden ones.
192
+
- Matching on floats triggers `illegal_floating_point_literal_pattern`. This triggers on *all* float matches, not just the forbidden ones.
193
193
It has been around for years, but is not currently shown in dependencies.
194
194
195
195
When the RFC gets accepted, the floating-point lint should be adjusted to only cover the cases we are really going to reject,
0 commit comments