@@ -31,17 +31,17 @@ might come across!
31
31
32
32
## What's in 1.64.0 stable
33
33
34
- ### C-compatible ffi types in core and alloc
34
+ ### C-compatible FFI types in core and alloc
35
35
36
- When calling or being called by C ABIs, Rust code can use types like ` c_uint `
37
- or ` c_ulong ` to match the corresponding types from C on any target, without
38
- requiring target-specific code or conditionals.
36
+ When calling or being called by C ABIs, Rust code can use type aliases like
37
+ ` c_uint ` or ` c_ulong ` to match the corresponding types from C on any target,
38
+ without requiring target-specific code or conditionals.
39
39
40
- Previously, these types were only available in ` std ` , so code written for
41
- embedded targets and other scenarios that could only use ` core ` or ` alloc `
40
+ Previously, these type aliases were only available in ` std ` , so code written
41
+ for embedded targets and other scenarios that could only use ` core ` or ` alloc `
42
42
could not use these types.
43
43
44
- Rust 1.64 now provides all of the ` c_* ` types in
44
+ Rust 1.64 now provides all of the ` c_* ` type aliases in
45
45
[ ` core::ffi ` ] ( https://doc.rust-lang.org/core/ffi/index.html ) , as well as
46
46
[ ` core::ffi::CStr ` ] ( https://doc.rust-lang.org/core/ffi/struct.CStr.html ) for
47
47
working with C strings. Rust 1.64 also provides
@@ -72,7 +72,9 @@ Such internal implementation details of the standard library are *never*
72
72
considered a stable interface. Nonetheless, because multiple crates relied on
73
73
this, we first worked with the authors of all of the still-maintained crates
74
74
doing so to arrange for the release of new versions, and to yank the old ones,
75
- before making this change.
75
+ before making this change. New releases for known affected crates have been out
76
+ for typically over a year, and the vast majority of impacted users should be
77
+ able to mitigate with a ` cargo update ` if needed."
76
78
77
79
See < https://github.com/rust-lang/rust/pull/78802 > for more details.
78
80
@@ -94,9 +96,9 @@ Rust 1.64 stabilizes the
94
96
trait. ` IntoFuture ` is a trait similar to
95
97
[ ` IntoIterator ` ] ( https://doc.rust-lang.org/std/iter/trait.IntoIterator.html ) ,
96
98
but rather than supporting ` for ... in ... ` loops, ` IntoFuture ` changes how
97
- ` .await ` works. With ` IntoFuture ` , the ` .await ` keyword can await mor ethan
98
- just futures; it can await _ anything which can be converted into a ` Future ` via
99
- ` IntoFuture ` _ - which can help make your APIs more user-friendly!
99
+ ` .await ` works. With ` IntoFuture ` , the ` .await ` keyword can await more than
100
+ just futures; it can await * anything which can be converted into a ` Future ` via
101
+ ` IntoFuture ` * - which can help make your APIs more user-friendly!
100
102
101
103
Take for example a builder which constructs requests to some storage provider
102
104
over the network:
@@ -128,6 +130,7 @@ let response = StorageRequest::new() // 1. create a new instance
128
130
This is not bad, but we can do better here. Using ` IntoFuture ` we can combine
129
131
_ "construct the future"_ (line 3) and _ "run the future"_ (line 4) into a single
130
132
step:
133
+
131
134
``` rust
132
135
let response = StorageRequest :: new () // 1. create a new instance
133
136
. set_debug (true ) // 2. set some option
@@ -168,6 +171,7 @@ impl IntoFuture for StorageRequest {
168
171
}
169
172
}
170
173
```
174
+
171
175
This takes a bit more code to implement, but provides a simpler API for users.
172
176
173
177
In the future, the Rust Async WG hopes to simplify the creating new named
0 commit comments