Skip to content

Commit 622d20a

Browse files
committed
Fix typos in librustc/ty/README.md
1 parent b796087 commit 622d20a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc/ty/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ wasteful.
4242
Often, we wish to write code that explicitly asserts that it is not
4343
taking place during inference. In that case, there is no "local"
4444
arena, and all the types that you can access are allocated in the
45-
global arena. To express this, the idea is to us the same lifetime
45+
global arena. To express this, the idea is to use the same lifetime
4646
for the `'gcx` and `'tcx` parameters of `TyCtxt`. Just to be a touch
4747
confusing, we tend to use the name `'tcx` in such contexts. Here is an
4848
example:
@@ -100,10 +100,10 @@ fn test_type<'tcx>(ty: Ty<'tcx>) {
100100

101101
The `sty` field (the origin of this name is unclear to me; perhaps
102102
structural type?) is of type `TypeVariants<'tcx>`, which is an enum
103-
definined all of the different kinds of types in the compiler.
103+
defining all of the different kinds of types in the compiler.
104104

105105
> NB: inspecting the `sty` field on types during type inference can be
106-
> risky, as there are may be inference variables and other things to
106+
> risky, as there may be inference variables and other things to
107107
> consider, or sometimes types are not yet known that will become
108108
> known later.).
109109
@@ -132,7 +132,7 @@ a safe approximation, so that is what you get back.
132132
> you are going to be testing for type equality, you probably need to
133133
> start looking into the inference code to do it right.
134134
135-
You can also find various common types in the tcx itself by accessing
135+
You can also find various common types in the `tcx` itself by accessing
136136
`tcx.types.bool`, `tcx.types.char`, etc (see `CommonTypes` for more).
137137

138138
### Beyond types: Other kinds of arena-allocated data structures
@@ -143,7 +143,7 @@ module. Here are a few examples:
143143

144144
- `Substs`, allocated with `mk_substs` -- this will intern a slice of types, often used to
145145
specify the values to be substituted for generics (e.g., `HashMap<i32, u32>`
146-
would be represented as a slice `&'tcx [tcx.types.i32, tcx.types.u32]`.
146+
would be represented as a slice `&'tcx [tcx.types.i32, tcx.types.u32]`).
147147
- `TraitRef`, typically passed by value -- a **trait reference**
148148
consists of a reference to a trait along with its various type
149149
parameters (including `Self`), like `i32: Display` (here, the def-id

0 commit comments

Comments
 (0)