@@ -14,9 +14,9 @@ Finalize the [Field Projections RFC] and implement it for use in nightly.
14
14
15
15
## Motivation
16
16
17
- Rust programs often makes use of custom pointer/reference types (for example ` Arc<T> ` ) instead of
17
+ Rust programs often make use of custom pointer/reference types (for example ` Arc<T> ` ) instead of
18
18
using plain references. In addition, container types are used to add or remove invariants on objects
19
- (for example ` MaybeUninit<T> ` ). These types have significantly less ergonomics when trying to
19
+ (for example ` MaybeUninit<T> ` ). These types have significantly worse ergonomics when trying to
20
20
operate on fields of the contained types compared to references.
21
21
22
22
### The status quo
@@ -33,14 +33,14 @@ ergonomic use of `NonNull<T>` over `*mut T` for accessing fields.
33
33
34
34
In the following sections, we will cover the basic usage first. And then we will go over the most
35
35
complex version that is required for [ pin projections] as well as allowing custom projections such
36
- as the abstraction for RCU from the Rust for Linux project (also given below) .
36
+ as the abstraction for RCU from the Rust for Linux project.
37
37
38
38
[ pin projections ] : https://doc.rust-lang.org/std/pin/index.html#projections-and-structural-pinning
39
39
[ Pin projections ] : https://doc.rust-lang.org/std/pin/index.html#projections-and-structural-pinning
40
40
41
41
#### Ergonomic Pointer-to-Field Operations
42
42
43
- We will use the struct from the summary as a simple example:
43
+ We will use the struct from the RFC's summary as a simple example:
44
44
45
45
``` rust
46
46
struct Foo {
@@ -68,7 +68,7 @@ can thus not be written using a single generic function. For this reason, many p
68
68
pointers even though ` NonNull<T> ` would be more fitting. The same can be said about `&mut
69
69
MaybeUninit<T >`.
70
70
71
- Field projection is adding a new operator that allows types to provide operations generic over the
71
+ Field projection adds a new operator that allows types to provide operations generic over the
72
72
fields of structs. For example, one can use the field projections on ` MaybeUninit<T> ` to safely
73
73
initialize ` Foo ` :
74
74
0 commit comments