Skip to content

Commit b4940bb

Browse files
committed
fix some more typos
1 parent a1e4273 commit b4940bb

12 files changed

+16
-16
lines changed

Diff for: src/backend/backend-agnostic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ heavily on other parts of the crate. The separation of the code must not affect
4545
the logic of the code nor its performance.
4646

4747
For these reasons, the separation process involves two transformations that
48-
have to be done at the same time for the resulting code to compile :
48+
have to be done at the same time for the resulting code to compile:
4949

5050
1. replace all the LLVM-specific types by generics inside function signatures
5151
and structure definitions;

Diff for: src/closure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ The other option is to step through the code using lldb or gdb.
157157

158158
1. `rust-lldb build/host/stage1/bin/rustc test.rs`
159159
2. In lldb:
160-
1. `b upvar.rs:134` // Setting the breakpoint on a certain line in the upvar.rs file`
160+
1. `b upvar.rs:134` // Setting the breakpoint on a certain line in the upvar.rs file
161161
2. `r` // Run the program until it hits the breakpoint
162162

163163
Let's start with [`upvar.rs`][upvar]. This file has something called

Diff for: src/const-eval.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Prominent examples are:
1717
* need to be known to check for overlapping patterns
1818

1919
Additionally constant evaluation can be used to reduce the workload or binary
20-
size at runtime by precomputing complex operations at compiletime and only
20+
size at runtime by precomputing complex operations at compile time and only
2121
storing the result.
2222

2323
All uses of constant evaluation can either be categorized as "influencing the type system"

Diff for: src/diagnostics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Here are a few examples:
111111
their crate, making this a hard error would make refactoring and development
112112
very painful.
113113
- [future-incompatible lints]:
114-
these are silencable lints.
114+
these are silenceable lints.
115115
It was decided that making them fixed errors would cause too much breakage,
116116
so warnings are instead emitted,
117117
and will eventually be turned into fixed (hard) errors.

Diff for: src/opaque-types-impl-trait-inference.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ If that fails, we reveal the hidden type of the opaque type,
7878
but only to prove this specific trait bound, not in general.
7979
Revealing is done by invoking the `type_of` query on the `DefId` of the opaque type.
8080
The query will internally request the hidden types from the defining function(s)
81-
and return that (see [the section on `type_of`](#Within-the-type_of-query) for more details).
81+
and return that (see [the section on `type_of`](#within-the-type_of-query) for more details).
8282

8383
#### Flowchart of type checking steps
8484

Diff for: src/solve/caching.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ TODO: write this :3
9898
[req-depth-ck]: https://github.com/rust-lang/rust/blob/7606c13961ddc1174b70638e934df0439b7dc515/compiler/rustc_middle/src/traits/solve/cache.rs#L76-L86
9999
[update-depth]: https://github.com/rust-lang/rust/blob/7606c13961ddc1174b70638e934df0439b7dc515/compiler/rustc_trait_selection/src/solve/search_graph.rs#L308
100100
[rem-depth]: https://github.com/rust-lang/rust/blob/7606c13961ddc1174b70638e934df0439b7dc515/compiler/rustc_middle/src/traits/solve/cache.rs#L124
101-
[^1]: This is overly restrictive: if all nested goal return the overflow response with some
102-
availabledepth `n`, then their result should be the same for any depths smaller than `n`.
101+
[^1]: This is overly restrictive: if all nested goals return the overflow response with some
102+
available depth `n`, then their result should be the same for any depths smaller than `n`.
103103
We can implement this optimization in the future.
104104

105105
[chapter on coinduction]: ./coinduction.md

Diff for: src/solve/invariants.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ inference variables in both the lhs and rhs, the now potentially structurally di
3333
types should still be equal to each other.
3434

3535
Needed to prevent goals from succeeding in HIR typeck and then failing in MIR borrowck.
36-
If this does invariant is broken MIR typeck ends up failing with an ICE.
36+
If this invariant is broken MIR typeck ends up failing with an ICE.
3737

3838
### Applying inference results from a goal does not change its result ❌
3939

@@ -91,7 +91,7 @@ it can easily result in unsoundness, e.g. [#57893](https://github.com/rust-lang/
9191

9292
If a trait goal holds with an empty environment, there should be a unique `impl`,
9393
either user-defined or builtin, which is used to prove that goal. This is
94-
necessary to select a unique method. It
94+
necessary to select a unique method.
9595

9696
We do however break this invariant in few cases, some of which are due to bugs,
9797
some by design:

Diff for: src/solve/the-solver.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ a separate "probe", to not leak inference constraints to the other candidates.
2525
We then try to merge the assembled candidates via `EvalCtxt::merge_candidates`.
2626

2727

28-
## Important concepts and design pattern
28+
## Important concepts and design patterns
2929

3030
### `EvalCtxt::add_goal`
3131

@@ -64,7 +64,7 @@ eagerly instantiates `'a` with a placeholder and then recursively proves
6464
Some goals can be proven in multiple ways. In these cases we try each option in
6565
a separate "probe" and then attempt to merge the resulting responses by using
6666
`EvalCtxt::try_merge_responses`. If merging the responses fails, we use
67-
`EvalCtxt::flounder` instead, returning ambiguity. For some goals, we try
67+
`EvalCtxt::flounder` instead, returning ambiguity. For some goals, we try to
6868
incompletely prefer some choices over others in case `EvalCtxt::try_merge_responses`
6969
fails.
7070

Diff for: src/traits/implied-bounds.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ requirements of impls and functions as explicit predicates.
4141

4242
These bounds are not added to the `ParamEnv` of the affected item itself. For lexical
4343
region resolution they are added using [`fn OutlivesEnvironment::with_bounds`].
44-
Similarly,during MIR borrowck we add them using
44+
Similarly, during MIR borrowck we add them using
4545
[`fn UniversalRegionRelationsBuilder::add_implied_bounds`].
4646

4747
[We add implied bounds for the function signature and impl header in MIR borrowck][mir].
@@ -81,4 +81,4 @@ This results in multiple unsoundnesses:
8181

8282
[#25860]: https://github.com/rust-lang/rust/issues/25860
8383
[#84591]: https://github.com/rust-lang/rust/issues/84591
84-
[#100051]: https://github.com/rust-lang/rust/issues/100051
84+
[#100051]: https://github.com/rust-lang/rust/issues/100051

Diff for: src/ty_module/binders.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Usages of these parameters is represented by the `RegionKind::Bound` (or `TyKind
1616
- A [`BoundVar`] which specifies which of the parameters the `Binder` introduces we are referring to.
1717
- We also sometimes store some extra information for diagnostics reasons via the [`BoundTyKind`]/[`BoundRegionKind`] but this is not important for type equality or more generally the semantics of `Ty`. (omitted from the above example)
1818

19-
In debug output (and also informally when talking to eachother) we tend to write these bound variables in the format of `^DebruijnIndex_BoundVar`. The above example would instead be written as `Binder(fn(&'^0_0), &[BoundVariableKind::Region])`. Sometimes when the `DebruijnIndex` is `0` we just omit it and would write `^0`.
19+
In debug output (and also informally when talking to each other) we tend to write these bound variables in the format of `^DebruijnIndex_BoundVar`. The above example would instead be written as `Binder(fn(&'^0_0), &[BoundVariableKind::Region])`. Sometimes when the `DebruijnIndex` is `0` we just omit it and would write `^0`.
2020

2121
Another concrete example, this time a mixture of `for<'a>` in a where clause and a type:
2222
```

Diff for: src/ty_module/early_binder.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn bar(foo: Foo<u32, f32>) {
4848
In the compiler the `instantiate` call for this is done in [`FieldDef::ty`] ([src][field_def_ty_src]), at some point during type checking `bar` we will wind up calling `FieldDef::ty(x, &[u32, f32])` in order to obtain the type of `foo.x`.
4949

5050
**Note on indices:** It is a bug if the index of a `Param` does not match what the `EarlyBinder` binds. For
51-
example, if the index is out of bounds or the index index of a lifetime corresponds to a type parameter.
51+
example, if the index is out of bounds or the index of a lifetime corresponds to a type parameter.
5252
These sorts of errors are caught earlier in the compiler during name resolution where we disallow references
5353
to generics parameters introduced by items that should not be nameable by the inner item.
5454

Diff for: src/ty_module/param_ty_const_regions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Concretely given the `ty::Generics` for the item the parameter is defined on, if
5353

5454
The index fully defines the `Ty` and is the only part of `TyKind::Param` that matters for reasoning about the code we are compiling.
5555

56-
Generally we do not care what the name is and only use the index is included for diagnostics and debug logs as otherwise it would be
56+
Generally we do not care what the name is and only use the index. The name is included for diagnostics and debug logs as otherwise it would be
5757
incredibly difficult to understand the output, i.e. `Vec<Param(0)>: Sized` vs `Vec<T>: Sized`. In debug output, parameter types are
5858
often printed out as `{name}/#{index}`, for example in the function `foo` if we were to debug print `Vec<T>` it would be written as `Vec<T/#0>`.
5959

0 commit comments

Comments
 (0)