Skip to content

Commit a59282d

Browse files
committed
Fix typos in README.md
1 parent c0e0a38 commit a59282d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/librustc/hir/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ carry around references into the HIR, but rather to carry around
5757
*identifier numbers* (or just "ids"). Right now, you will find four
5858
sorts of identifiers in active use:
5959

60-
- `DefId`, which primarily name "definitions" or top-level items.
60+
- `DefId`, which primarily names "definitions" or top-level items.
6161
- You can think of a `DefId` as being shorthand for a very explicit
6262
and complete path, like `std::collections::HashMap`. However,
6363
these paths are able to name things that are not nameable in
@@ -114,6 +114,6 @@ A **body** represents some kind of executable code, such as the body
114114
of a function/closure or the definition of a constant. Bodies are
115115
associated with an **owner**, which is typically some kind of item
116116
(e.g., a `fn()` or `const`), but could also be a closure expression
117-
(e.g., `|x, y| x + y`). You can use the HIR map to find find the body
117+
(e.g., `|x, y| x + y`). You can use the HIR map to find the body
118118
associated with a given def-id (`maybe_body_owned_by()`) or to find
119119
the owner of a body (`body_owner_def_id()`).

src/librustc/mir/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ register and define new MIR transformations and analyses.
66

77
Most of the code that operates on MIR can be found in the
88
`librustc_mir` crate or other crates. The code found here in
9-
`librustc` is just the datatype definitions, alonging the functions
9+
`librustc` is just the datatype definitions, along with the functions
1010
which operate on MIR to be placed everywhere else.
1111

1212
## MIR Data Types and visitor
@@ -27,7 +27,7 @@ As a MIR *consumer*, you are expected to use one of the queries that
2727
returns a "final MIR". As of the time of this writing, there is only
2828
one: `optimized_mir(def_id)`, but more are expected to come in the
2929
future. For foreign def-ids, we simply read the MIR from the other
30-
crate's metadata. But for local query, this query will construct the
30+
crate's metadata. But for local def-ids, the query will construct the
3131
MIR and then iteratively optimize it by putting it through various
3232
pipeline stages. This section describes those pipeline stages and how
3333
you can extend them.
@@ -51,7 +51,7 @@ a `&'tcx Steal<Mir<'tcx>>`, allocated using
5151
**stolen** by the next suite of optimizations -- this is an
5252
optimization to avoid cloning the MIR. Attempting to use a stolen
5353
result will cause a panic in the compiler. Therefore, it is important
54-
that you not read directly from these intermediate queries except as
54+
that you do not read directly from these intermediate queries except as
5555
part of the MIR processing pipeline.
5656

5757
Because of this stealing mechanism, some care must also be taken to

src/librustc/ty/maps/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ That is, they take an `&mut Providers` and mutate it in place. Usually
169169
we use the formulation above just because it looks nice, but you could
170170
as well do `providers.type_of = type_of`, which would be equivalent.
171171
(Here, `type_of` would be a top-level function, defined as we saw
172-
before.) So, if we wanted to have add a provider for some other query,
172+
before.) So, if we want to add a provider for some other query,
173173
let's call it `fubar`, into the crate above, we might modify the `provide()`
174174
function like so:
175175

@@ -185,7 +185,7 @@ pub fn provide(providers: &mut Providers) {
185185
fn fubar<'cx, 'tcx>(tcx: TyCtxt<'cx, 'tcx>, key: DefId) -> Fubar<'tcx> { .. }
186186
```
187187

188-
NB. Most of the `rustc_*` crate only provide **local
188+
NB. Most of the `rustc_*` crates only provide **local
189189
providers**. Almost all **extern providers** wind up going through the
190190
`rustc_metadata` crate, which loads the information from the crate
191191
metadata. But in some cases there are crates that provide queries for
@@ -201,7 +201,7 @@ Well, defining a query takes place in two steps:
201201
1. first, you have to specify the query name and arguments; and then,
202202
2. you have to supply query providers where needed.
203203

204-
The specify the query name and arguments, you simply add an entry
204+
To specify the query name and arguments, you simply add an entry
205205
to the big macro invocation in `mod.rs`. This will probably have changed
206206
by the time you read this README, but at present it looks something
207207
like:

0 commit comments

Comments
 (0)