Skip to content

Commit 11dc4e4

Browse files
committed
Do some copyediting
In a final read through the document, we found a few miscellaneous words and commas worth tweaking here and there, so let's tweak them.
1 parent dc258ba commit 11dc4e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

text/3617-precise-capturing.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ All type parameters in scope are implicitly captured in RPIT-like `impl Trait` o
4242

4343
In RFC 3498, we decided to capture all in-scope generic parameters in RPIT-like `impl Trait` opaque types, across all editions, for new features we were stabilizing such as return position `impl Trait` in Trait (RPITIT) and associated type position `impl Trait` (ATPIT), and to capture all in-scope generic parameters for RPIT on bare functions and on inherent functions and methods starting in the Rust 2024 edition. Doing this made the language more predictable and consistent, eliminated weird "tricks", and, by solving key problems, allowed for the stabilization of RPITIT.
4444

45-
However, the expansion of the RPIT rules in Rust 2024 means that some existing uses of RPIT, when migrated to Rust 2024, will now capture lifetime parameters that were not previously captured, and this may result in code failing to compile. For example, consider:
45+
However, the expansion of the RPIT capture rules in Rust 2024 means that some existing uses of RPIT, when migrated to Rust 2024, will now capture lifetime parameters that were not previously captured, and this may result in code failing to compile. For example, consider:
4646

4747
```rust
4848
//@ edition: 2021
@@ -64,7 +64,7 @@ We need some way to migrate this kind of code.
6464

6565
In all editions, RPIT-like `impl Trait` opaque types may include `use<..>` before any bounds to specify which in-scope generic parameters are captured or that no in-scope generic parameters are captured (with `use<>`). If `use<..>` is provided, it entirely overrides the implicit rules for which generic parameters are captured.
6666

67-
One way to think about `use<..>` is that, in Rust `use` brings things *into scope*, and here we are bringing certain generic parameters into scope for the hidden type.
67+
One way to think about `use<..>` is that, in Rust, `use` brings things *into scope*, and here we are bringing certain generic parameters into scope for the hidden type.
6868

6969
For example, we can solve the overcapturing in the original motivating example by writing:
7070

@@ -703,7 +703,7 @@ As we saw in the reference desugaring above, associated type position `impl Trai
703703

704704
As it turned out, there are four problems with this:
705705

706-
1. ATPIT/TAIT is too indirect a solution.
706+
1. These features are too indirect a solution.
707707
2. They might not be stabilized in time.
708708
3. They would lead to a worse migration story.
709709
4. We would want this syntax anyway.
@@ -754,7 +754,7 @@ This is the syntax used throughout this RFC (but see the [unresolved questions][
754754

755755
Using a separate keyword makes this syntax more scalable in the sense that we can apply `use<..>` in other places.
756756

757-
Conveniently, the word "use" is quite appropriate here, since we are *using* the generic parameters in the type of the opaque type and allowing the generic parameters to be *used* in the hidden type. That is, with `use`, we are bringing the generic parameters *into scope* for the hidden type, and `use` is the keyword in Rust for bringing things into scope.
757+
Conveniently, the word "use" is quite appropriate here, since we are *using* the generic parameters in the opaque type and allowing the generic parameters to be *used* in the hidden type. That is, with `use`, we are bringing the generic parameters *into scope* for the hidden type, and `use` is the keyword in Rust for bringing things into scope.
758758

759759
Picking an existing keyword allows for this syntax, including extensions to other positions, to be allowed in older editions. Because `use` is a full keyword, we're not limited in where it can be placed.
760760

0 commit comments

Comments
 (0)