Skip to content

Commit 5485a0f

Browse files
Apply suggestions from code review
Thanks kennytm! Co-authored-by: kennytm <kennytm@gmail.com>
1 parent 231bcf0 commit 5485a0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

text/0000-return-type-notation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ but we will use it to define the semantics of Return Type Notation.
546546

547547
Return Type Notation extends the type grammar roughly as follows,
548548
where `?` indicates an optional nonterminal and `,*` indicates a comma
549-
separated list. These changes permit `where T::method(): Send`.
549+
separated list. These changes permit `where T::method(..): Send`.
550550

551551
```ebnf
552552
Type = i32
@@ -775,7 +775,7 @@ and a function bounding it
775775
fn start_health_check<H>(health_check: H, server: Server)
776776
where
777777
H: HealthCheck + Send + 'static,
778-
H::check(): Send, // 👈 How would we write this with `typeof`?
778+
H::check(..): Send, // 👈 How would we write this with `typeof`?
779779
```
780780

781781
To write the above with `typeof`, you would do something like this
@@ -859,7 +859,7 @@ To address the challenge of an implicit name, we could allow people to explicitl
859859

860860
```rust
861861
trait Factory {
862-
#[associated_return_type(Widget)]
862+
#[associated_return_type(Widgets)]
863863
fn widgets(&self) -> impl Iterator<Item = Widget>;
864864
}
865865
```
@@ -1035,7 +1035,7 @@ There are multiple ways we could write this where-clause, varying in their speci
10351035
* `where C::capture(..): Send` -- this indicates that `C::capture()` will return a `Send` value for any possible set of parameters
10361036
* `where C::capture(&mut C, i32): Send` -- this indicates that `C::capture()` will return a `Send` value when invoked specifically on a `&mut C` (for the `self` parameter) and an `i32`
10371037
* `where for<'a> C::capture(&'a mut C, i32): Send` -- same as the previous rule, but with the higher-ranked `'a` written explicitly
1038-
* `where C::capture::<i32>(): Send` -- this indicates that `C::capture()` will return a `Send` value for any possible set of parameters, but with its `T` parameter set explicitly to `i32`
1038+
* `where C::capture::<i32>(..): Send` -- this indicates that `C::capture()` will return a `Send` value for any possible set of parameters, but with its `T` parameter set explicitly to `i32`
10391039
* `where C::capture::<i32>(&mut C, i32): Send` -- this indicates that `C::capture()` will return a `Send` value when its `T` parameter is `i32`
10401040
* `where for<'a> C::capture::<i32>(&'a mut C, i32): Send` -- same as the previous rule, but with the higher-ranked `'a` written explicitly
10411041

@@ -1101,5 +1101,5 @@ We expect to make traits with async functions and RPITIT dyn safe in the future
11011101

11021102
## Naming the zero-sized types for a method
11031103

1104-
Every function and method `f` in Rust has a corresponding zero-sized type that uniquely identifies `f`. The RTN notation `T::check(..)` refers to the return value of `check`; conceivably `T::check` (without the parens) could be used to refer the type of `check` itself. In this case, `T::check()` can be thought of as shorthand for `<T::check as Fn<_>>::Output`.
1104+
Every function and method `f` in Rust has a corresponding zero-sized type that uniquely identifies `f`. The RTN notation `T::check(..)` refers to the return value of `check`; conceivably `T::check` (without the parens) could be used to refer the type of `check` itself. In this case, `T::check(..)` can be thought of as shorthand for `<T::check as Fn<_>>::Output`.
11051105

0 commit comments

Comments
 (0)