Skip to content

Commit 71fb550

Browse files
committed
Remove typos and fix grammar
1 parent 139d48e commit 71fb550

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

text/1522-conservative-impl-trait.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Here are some problems that unboxed abstract types solve or mitigate:
9797

9898
* _Returning unboxed closures_. Closure syntax generates an anonymous type
9999
implementing a closure trait. Without unboxed abstract types, there is no way
100-
to use this syntax while returning the resulting closure unboxed, because there
100+
to use this syntax while returning the resulting closure unboxed because there
101101
is no way to write the name of the generated type.
102102

103103
* _Leaky APIs_. Functions can easily leak implementation details in their return
@@ -141,7 +141,7 @@ with other extensions.
141141
## Syntax
142142

143143
Let's start with the bikeshed: The proposed syntax is `impl Trait` in return type
144-
position, composing like trait objects to forms like `impl Foo+Send+'a`.
144+
position, composing like trait objects to forms like `impl Foo + Send + 'a`.
145145

146146
It can be explained as "a type that implements `Trait`",
147147
and has been used in that form in most earlier discussions and proposals.
@@ -162,7 +162,7 @@ The core semantics of the feature is described below.
162162

163163
Note that the sections after this one go into more detail on some of the design
164164
decisions, and that **it is likely for many of the mentioned limitations to be
165-
lifted at some point in the future**. For clarity, we'll separately categories the *core
165+
lifted at some point in the future**. For clarity, we'll separately categorize the *core
166166
semantics* of the feature (aspects that would stay unchanged with future extensions)
167167
and the *initial limitations* (which are likely to be lifted later).
168168

@@ -181,7 +181,7 @@ and the *initial limitations* (which are likely to be lifted later).
181181
- The type would not be known to implement any other trait, with
182182
the exception of OIBITS (aka "auto traits") and default traits like `Sized`.
183183
- The type would not be considered equal to the actual underlying type.
184-
- The type would not be allowed to appear as the Self type for an `impl` block.
184+
- The type would not be allowed to appear as the `Self` type for an `impl` block.
185185

186186
- Because OIBITS like `Send` and `Sync` will leak through an abstract return
187187
type, there will be some additional complexity in the compiler due to some
@@ -223,7 +223,7 @@ and the *initial limitations* (which are likely to be lifted later).
223223
unless these are themselves part of a legal return type.
224224

225225
- Eventually, we will want to allow the feature to be used within traits, and
226-
like in argument position as well (as an ergonomic improvement over today's generics).
226+
likely in argument position as well (as an ergonomic improvement over today's generics).
227227
- Using `impl Trait` multiple times in the same return type would be valid,
228228
like for example in `-> (impl Foo, impl Bar)`.
229229

@@ -252,7 +252,7 @@ and the *initial limitations* (which are likely to be lifted later).
252252

253253
## Rationale
254254

255-
### Why this semantics for the return type?
255+
### Why these semantics for the return type?
256256

257257
There has been a lot of discussion about what the semantics of the return type
258258
should be, with the theoretical extremes being "full return type inference" and
@@ -410,11 +410,11 @@ so the syntax is forbidden there.
410410

411411
### Compatibility with conditional trait bounds
412412

413-
On valid critique for the existing `impl Trait` proposal is that it does not
414-
cover more complex scenarios, where the return type would implement
413+
One valid critique for the existing `impl Trait` proposal is that it does not
414+
cover more complex scenarios where the return type would implement
415415
one or more traits depending on whether a type parameter does so with another.
416416

417-
For example, a iterator adapter might want to implement `Iterator` and
417+
For example, an iterator adapter might want to implement `Iterator` and
418418
`DoubleEndedIterator`, depending on whether the adapted one does:
419419

420420
```rust
@@ -426,7 +426,7 @@ impl<I: DoubleEndedIterator> DoubleEndedIterator for SkipOne<I> { ... }
426426

427427
Using just `-> impl Iterator`, this would not be possible to reproduce.
428428

429-
Since there has been no proposals so far that would address this in a way
429+
Since there have been no proposals so far that would address this in a way
430430
that would conflict with the fixed-trait-set case, this RFC punts on that issue as well.
431431

432432
### Limitation to free/inherent functions
@@ -435,10 +435,10 @@ One important usecase of abstract return types is to use them in trait methods.
435435

436436
However, there is an issue with this, namely that in combinations with generic
437437
trait methods, they are effectively equivalent to higher kinded types.
438-
Which is an issue because Rust HKT story is not yet figured out, so
438+
Which is an issue because Rust's HKT story is not yet figured out, so
439439
any "accidental implementation" might cause unintended fallout.
440440

441-
HKT allows you to be generic over a type constructor, aka a
441+
HKT allows you to be generic over a type constructor, a.k.a. a
442442
"thing with type parameters", and then instantiate them at some later point to
443443
get the actual type.
444444
For example, given a HK type `T` that takes one type as parameter, you could
@@ -459,7 +459,7 @@ with a `u32` or `bool`,
459459
just like `T<u32>` and `T<bool>` might give us `Vec<u32>` or `Box<bool>`
460460
in the example above.
461461

462-
The problem does not exists with trait method return types today because
462+
The problem does not exist with trait method return types today because
463463
they are concrete:
464464

465465
```rust
@@ -472,7 +472,7 @@ Given the above code, there is no way for `bar` to choose a return type `X`
472472
that could fundamentally differ between instantiations of `Self`
473473
while still being instantiable with an arbitrary `U`.
474474

475-
At most you could return a associated type, but then you'd loose the generics
475+
At most you could return a associated type, but then you'd lose the generics
476476
from `bar`
477477

478478
```rust
@@ -482,7 +482,7 @@ trait Foo {
482482
}
483483
```
484484

485-
So, in conclusion, since Rusts HKT story is not yet fleshed out,
485+
So, in conclusion, since Rust's HKT story is not yet fleshed out,
486486
and the compatibility of the current compiler with it is unknown,
487487
it is not yet possible to reach a concrete solution here.
488488

0 commit comments

Comments
 (0)