Skip to content

Commit 03044a3

Browse files
nikomatsakismark-i-m
authored andcommitted
address nits
1 parent 64963f8 commit 03044a3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/glossary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ region | another term for "lifetime" often used in the literat
4343
sess | the compiler session, which stores global data used throughout compilation
4444
side tables | because the AST and HIR are immutable once created, we often carry extra information about them in the form of hashtables, indexed by the id of a particular node.
4545
sigil | like a keyword but composed entirely of non-alphanumeric tokens. For example, `&` is a sigil for references.
46-
skolemization | a way of handling subtyping around "for-all" types (e.g., `for<'a> fn(&'a u32)` as well as solving higher-ranked trait bounds (e.g., `for<'a> T: Trait<'a>`). See [the chapter on skolemization and universes](./mir-regionck.html#skol) for more details.
46+
skolemization | a way of handling subtyping around "for-all" types (e.g., `for<'a> fn(&'a u32)`) as well as solving higher-ranked trait bounds (e.g., `for<'a> T: Trait<'a>`). See [the chapter on skolemization and universes](./mir-regionck.html#skol) for more details.
4747
soundness | soundness is a technical term in type theory. Roughly, if a type system is sound, then if a program type-checks, it is type-safe; i.e. I can never (in safe rust) force a value into a variable of the wrong type. (see "completeness").
4848
span | a location in the user's source code, used for error reporting primarily. These are like a file-name/line-number/column tuple on steroids: they carry a start/end point, and also track macro expansions and compiler desugaring. All while being packed into a few bytes (really, it's an index into a table). See the Span datatype for more.
4949
substs | the substitutions for a given generic type or item (e.g. the `i32`, `u32` in `HashMap<i32, u32>`)

src/mir-regionck.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The MIR-based region analysis consists of two major functions:
1212
- `replace_regions_in_mir`, invoked first, has two jobs:
1313
- First, it finds the set of regions that appear within the
1414
signature of the function (e.g., `'a` in `fn foo<'a>(&'a u32) {
15-
... }`. These are called the "universal" or "free" regions -- in
15+
... }`). These are called the "universal" or "free" regions -- in
1616
particular, they are the regions that [appear free][fvb] in the
1717
function body.
1818
- Second, it replaces all the regions from the function body with
@@ -164,7 +164,8 @@ are in scope within some type or at some point. Universes are formed
164164
into a tree, where each child extends its parents with some new names.
165165
So the **root universe** conceptually contains global names, such as
166166
the the lifetime `'static` or the type `i32`. In the compiler, we also
167-
put generic type parameters into this root universe. So consider
167+
put generic type parameters into this root universe (in this sense,
168+
there is not just one root universe, but one per item). So consider
168169
this function `bar`:
169170

170171
```rust
@@ -175,7 +176,7 @@ fn bar<'a, T>(t: &'a T) {
175176
}
176177
```
177178

178-
Here, the root universe would consider of the lifetimes `'static` and
179+
Here, the root universe would consist of the lifetimes `'static` and
179180
`'a`. In fact, although we're focused on lifetimes here, we can apply
180181
the same concept to types, in which case the types `Foo` and `T` would
181182
be in the root universe (along with other global types, like `i32`).
@@ -214,7 +215,7 @@ fn bar<'a, T>(t: &'a T) {
214215
```
215216

216217
When we enter *this* type, we will again create a new universe, which
217-
let's call `U2`. It's parent will be the root universe, and U1 will be
218+
we'll call `U2`. Its parent will be the root universe, and U1 will be
218219
its sibling:
219220

220221
```

0 commit comments

Comments
 (0)