Skip to content

Commit 2d8cf77

Browse files
committed
Make some editorial tweaks on the RTN post
These tweaks were informed by looking at the rendered copy.
1 parent a8f65cd commit 2d8cf77

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

posts/inside-rust/2024-09-26-rtn-call-for-testing.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: Michael Goulet
55
team: The Async Working Group <https://www.rust-lang.org/governance/wgs/wg-async>
66
---
77

8-
The async working group is excited to announce that [RFC 3654] return type notation (RTN) is ready for testing. In this post, we want to briefly describe the feature and announce a call for testing on nightly Rust.
8+
The async working group is excited to announce that [RFC 3654] return type notation (RTN) is ready for testing on nightly Rust. In this post, we'll briefly describe the feature.
99

1010
## The backstory
1111

@@ -24,7 +24,8 @@ trait Foo {
2424

2525
fn needs_sendable_future<T: Foo>()
2626
where
27-
// How do we further restrict `T::method()` to be `Send + 'static`?
27+
// How do we further restrict `T::method()`
28+
// to be `Send + 'static`?
2829
{
2930
spawn(T::method());
3031
//~^ ERROR: `impl Future<Output = ()>` is not `Send`!
@@ -69,7 +70,7 @@ In [RFC 3654] we introduced return type notation (RTN). This will allow us to wr
6970
```rust
7071
fn needs_sendable_future<T: Foo>()
7172
where
72-
T::method(..): Send + 'static //
73+
T::method(..): Send + 'static // Yay!
7374
{
7475
spawn(T::method());
7576
//~^ Works!
@@ -80,16 +81,16 @@ where
8081

8182
Currently, RTN is only allowed for trait associated functions and methods with lifetime generics (not const or type generics) that use:
8283

83-
* async fn in traits (AFIT)
84-
* return-position impl Trait in traits (RPITIT) where the impl Trait is the outermost return type, i.e. `-> impl Trait`, but not `-> Box<impl Trait>`
84+
* async fn in traits (AFIT) or
85+
* return-position impl Trait in traits (RPITIT) where the impl Trait is the outermost return type, i.e. `-> impl Trait`, but not `-> Box<impl Trait>`.
8586

8687
These restrictions are described in further detail in [RFC 3654].
8788

8889
## How do I help?
8990

9091
We'd love for you to test out this feature on the latest Rust nightly compiler[^nightly].
9192

92-
[^nightly]: Make sure to run `rustup update nightly` or however you manage your Rust releases, since the feature is very new and is still unstable!
93+
[^nightly]: Make sure to run `rustup update nightly` (or however you manage your Rust releases), since the feature is very new and is still unstable!
9394

9495
Specifically, we'd like for you to identify traits where you're unnecessarily restricting your trait definitions with `+ Send` or similar bounds:
9596

0 commit comments

Comments
 (0)