Skip to content

Commit f3c908b

Browse files
authored
Merge pull request #2146 from Centril/master
Proofread RFC 2093 + Fixed start dates & feature names of RFCs 2089, 2093, 2132, 2133
2 parents 2a20c36 + 475c4ea commit f3c908b

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

text/2089-implied-bounds.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
- Feature Name: `implied-bounds`
2-
- Start Date: (fill me in with today's date, YYYY-MM-DD)
1+
- Feature Name: `implied_bounds`
2+
- Start Date: 2017-07-28
33
- RFC PR: https://github.com/rust-lang/rfcs/pull/2089
44
- Rust Issue: https://github.com/rust-lang/rust/issues/44491
55

text/2093-infer-outlives.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
- Feature Name: (fill me in with a unique ident, my_awesome_feature)
2-
- Start Date: (fill me in with today's date, YYYY-MM-DD)
1+
- Feature Name: `infer_outlives`
2+
- Start Date: 2017-08-02
33
- RFC PR: https://github.com/rust-lang/rfcs/pull/2093
44
- Rust Issue: https://github.com/rust-lang/rust/issues/44493
55

@@ -8,7 +8,7 @@
88

99
Remove the need for explicit `T: 'x` annotations on structs. We will
1010
infer their presence based on the fields of the struct. In short, if
11-
the struct contains a reference (directly or indirectly) to `T` with
11+
the struct contains a reference, directly or indirectly, to `T` with
1212
lifetime `'x`, then we will infer that `T: 'x` is a requirement:
1313

1414
```rust
@@ -24,7 +24,7 @@ lifetime defaults, and simply for backwards compatibility.
2424
# Motivation
2525
[motivation]: #motivation
2626

27-
Today, when you writes generic struct definitions that contain
27+
Today, when you write generic struct definitions that contain
2828
references, those structs require where-clauses of the form `T:
2929
'a`:
3030

@@ -73,7 +73,7 @@ fixed-point inference similar to [variance inference].
7373

7474
[variance inference]: https://github.com/rust-lang/rfcs/blob/master/text/0738-variance.md
7575

76-
There is one other (relatively obscure) place where explicit lifetime
76+
There is one other, relatively obscure, place where explicit lifetime
7777
annotations are used today: trait object lifetime defaults
7878
([RFC 599][]). The interaction there is discussed in the Guide-Level
7979
Explanation below.
@@ -97,7 +97,7 @@ has no references at all. (The "outlives" rules were later tweaked by
9797
In practice, this means that in Rust, when you define a struct that
9898
contains references to a generic type, or references to other
9999
references, you need to add various where clauses for that struct type
100-
to be considered valid. For example, consider this (currently invalid)
100+
to be considered valid. For example, consider the following (currently invalid)
101101
struct `SharedRef`:
102102

103103
```rust
@@ -123,7 +123,7 @@ struct SharedRef<'a, T>
123123
In principle, similar where clauses would be required on generic
124124
functions or impl to ensure that their parameters or inputs are
125125
well-formed. However, as you may have noticed, this is not the
126-
case. For example, this function is valid as written:
126+
case. For example, the following function is valid as written:
127127

128128
```rust
129129
fn foo<'a, T>(x: &'a T) {
@@ -190,7 +190,7 @@ impl<'a, T> MakeRef<'a> for Vec<T>
190190
In this case, the impl has two inputs -- the lifetime `'a` and the
191191
type `Vec<T>` (note that `'a` and `T` are the impl parameters; the
192192
inputs come from the parameters of the trait that is being
193-
implemented). Neither of these inputs requires that `T: 'a`, so when
193+
implemented). Neither of these inputs requires that `T: 'a`. So, when
194194
we try to specify the value of the associated type as `&'a T`, we
195195
still require a where clause to infer that `T: 'a` must hold.
196196

@@ -247,7 +247,7 @@ The type `Ref<'x, Debug>` defaults to `Ref<'x, Debug + 'x>` and not
247247
`Ref<'x, Debug + 'static>`. Effectively the `where T: 'a` declaration
248248
acts as a kind of signal that `Ref` acts as a "reference to `T`".
249249

250-
This RFC does not change these defaulting rules: in particular, these
250+
This RFC does not change these defaulting rules. In particular, these
251251
defaults are applied **before** where-clause inference takes place,
252252
and hence are not affected by the results. Trait object defaulting
253253
therefore requires an explicit `where T: 'a` declaration on the
@@ -336,7 +336,7 @@ annotation is still potentially a breaking change (even if it would be
336336
inferred), due to the trait object rules; but also, adding or removing
337337
a field of type `&'a T` could affect the results of inference, and
338338
hence may be a breaking change. As an example, consider a struct like
339-
this:
339+
the following:
340340

341341
```rust
342342
struct Iter<'a, T> {
@@ -407,7 +407,7 @@ This set must meet the constraints derived by the following algorithm.
407407

408408
First, if the struct contains a where-clause `C` matching the above
409409
forms, then we add the constraint that `C in A[S]`. So, for example,
410-
in this struct:
410+
in the following struct:
411411

412412
```rust
413413
struct Foo<'a, T> where T: 'a { .. }
@@ -428,7 +428,7 @@ the outlines of the algorithm:
428428
not necessarily a type parameter; for example, `&'a &'b i32` would
429429
lead to the outlives requirement that `'b: 'a`).
430430
- A reference to a struct like `Foo<'a, T>` may also require outlives
431-
requirements; this is determined by checking the (current) value of
431+
requirements. This is determined by checking the (current) value of
432432
`A[Foo]`, after substituting its parameters.
433433
- For an associated type reference like `<T as BarTrait<'a>>::Type`, we do
434434
not attempt normalization, but rather just check that `T` is well-formed.
@@ -483,7 +483,7 @@ Here, the requirement will be that `<T as Iterator>::Item: 'a`.
483483
### Example 3: Explicit where-clauses
484484

485485
In some cases, we may have constraints that arise from explicit where-clauses
486-
and not from field types, as in this example:
486+
and not from field types, as in the following example:
487487

488488
```rust
489489
struct Foo<'b, U> {

text/2132-copy-closures.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
- Feature Name: copy_closures
2-
- Start Date: 2017-8-27
1+
- Feature Name: `copy_closures`
2+
- Start Date: 2017-08-27
33
- RFC PR: https://github.com/rust-lang/rfcs/pull/2132
44
- Rust Issue: https://github.com/rust-lang/rust/issues/44490
55

text/2133-all-the-clones.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- Feature Name: all_the_clones
1+
- Feature Name: `all_the_clones`
22
- Start Date: 2017-08-28
33
- RFC PR: https://github.com/rust-lang/rfcs/pull/2133
44
- Rust Issue: https://github.com/rust-lang/rust/issues/44496

0 commit comments

Comments
 (0)