Skip to content

Commit 00657de

Browse files
RalfJungehuss
andauthored
typos
Co-authored-by: Eric Huss <[email protected]>
1 parent c77cbd6 commit 00657de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

text/0000-constants-in-patterns.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This new RFC takes the stance it does based on the following main design goals:
5252
[guide-level-explanation]: #guide-level-explanation
5353

5454
Constants can be used as patterns, but only if their type implements `PartialEq`.
55-
Morevoer, this implementation must be the automatically derived one, and that also applies recursively for the types of their fields (recursively):
55+
Moreover, this implementation must be the automatically derived one, and that also applies recursively for the types of their fields (recursively):
5656

5757
```rust
5858
#[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, `
100100

101101
- Pointer types (raw pointers and function pointers): these compare by test the memory address for equality.
102102
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
104104
(the "same" function can be duplicated across codegen units and this have different addresses,
105105
and different functions can be merged when they compile to the same assembly and thus have the same address).
106106
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
189189
This only recently landed (Rust 1.75, currently in beta), and is not currently shown in dependencies.
190190
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;
191191
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.
193193
It has been around for years, but is not currently shown in dependencies.
194194

195195
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

Comments
 (0)