Skip to content

Commit 6136199

Browse files
committed
Minor grammar and syntax fixes
Minor grammar and syntax fixes found while reading.
1 parent d16bde7 commit 6136199

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/trait-caching.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use is done by the method `pick_candidate_cache` in `select.rs`. At
5454
the moment, we use a very simple, conservative rule: if there are any
5555
where-clauses in scope, then we use the local cache. We used to try
5656
and draw finer-grained distinctions, but that led to a serious of
57-
annoying and weird bugs like #22019 and #18290. This simple rule seems
57+
annoying and weird bugs like [#22019] and [#18290]. This simple rule seems
5858
to be pretty clearly safe and also still retains a very high hit rate
5959
(~95% when compiling rustc).
6060

@@ -63,3 +63,5 @@ general, is this section still accurate at all?
6363

6464
[`ParamEnv`]: ./param_env.html
6565
[`tcx`]: ./ty.html
66+
[#18290]: https://github.com/rust-lang/rust/issues/18290
67+
[#22019]: https://github.com/rust-lang/rust/issues/22019

src/traits-associated-types.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ that syntax is expanded during
2020
["type collection"](./type-checking.html) into the explicit form,
2121
though that is something we may want to change in the future.)
2222

23+
[intoiter-item]: https://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html#associatedtype.Item
24+
2325
<a name=normalize>
2426

2527
In some cases, associated type projections can be **normalized** --
@@ -51,8 +53,8 @@ we saw above would be lowered to a program clause like so:
5153

5254
forall<T> {
5355
Normalize(<Option<T> as IntoIterator>::Item -> T)
54-
}
55-
56+
}
57+
5658
(An aside: since we do not permit quantification over traits, this is
5759
really more like a family of predicates, one for each associated
5860
type.)
@@ -98,7 +100,7 @@ We now introduce the `ProjectionEq` predicate to bring those two cases
98100
together. The `ProjectionEq` predicate looks like so:
99101

100102
ProjectionEq(<T as IntoIterator>::Item = U)
101-
103+
102104
and we will see that it can be proven *either* via normalization or
103105
skolemization. As part of lowering an associated type declaration from
104106
some trait, we create two program clauses for `ProjectionEq`:
@@ -123,7 +125,7 @@ with unification. As described in the
123125
basically a procedure with a signature like this:
124126

125127
Unify(A, B) = Result<(Subgoals, RegionConstraints), NoSolution>
126-
128+
127129
In other words, we try to unify two things A and B. That procedure
128130
might just fail, in which case we get back `Err(NoSolution)`. This
129131
would happen, for example, if we tried to unify `u32` and `i32`.

src/type-inference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ below in a separate section.
8484

8585
The most basic operations you can perform in the type inferencer is
8686
**equality**, which forces two types `T` and `U` to be the same. The
87-
recommended way to add an equality constraint is using the `at`
87+
recommended way to add an equality constraint is to use the `at`
8888
method, roughly like so:
8989

9090
```rust

0 commit comments

Comments
 (0)