From 152c08b1c9fc6f3c949dc4fe14b6b475ad6e33f4 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Sun, 4 Feb 2018 21:24:50 +0000 Subject: [PATCH] Very minor grammatical fixes. --- src/ty.md | 2 +- src/type-inference.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ty.md b/src/ty.md index 8b72d440..1da70d91 100644 --- a/src/ty.md +++ b/src/ty.md @@ -135,7 +135,7 @@ a safe approximation, so that is what you get back. You can also find various common types in the `tcx` itself by accessing `tcx.types.bool`, `tcx.types.char`, etc (see `CommonTypes` for more). -### Beyond types: Other kinds of arena-allocated data structures +### Beyond types: other kinds of arena-allocated data structures In addition to types, there are a number of other arena-allocated data structures that you can allocate, and which are found in this diff --git a/src/type-inference.md b/src/type-inference.md index 8155829f..ef97e59d 100644 --- a/src/type-inference.md +++ b/src/type-inference.md @@ -9,10 +9,10 @@ and higher-ranked types. We use the notation `?T` to refer to inference variables, also called existential variables. -We use the term "region" and "lifetime" interchangeably. Both refer to +We use the terms "region" and "lifetime" interchangeably. Both refer to the `'a` in `&'a T`. -The term "bound region" refers to regions bound in a function +The term "bound region" refers to a region bound in a function signature, such as the `'a` in `for<'a> fn(&'a u32)`. A region is "free" if it is not bound. @@ -158,7 +158,7 @@ is to first "generalize" `&'a i32` into a type with a region variable: relate this new variable with the original bound: &'?b i32 <: &'a i32 - + This will result in a region constraint (see below) of `'?b: 'a`. One final interesting case is relating two unbound type variables, @@ -175,7 +175,7 @@ make (almost) no attempt to solve regions. These constraints have the form of an outlives constraint: 'a: 'b - + Actually the code tends to view them as a subregion relation, but it's the same idea: @@ -188,7 +188,7 @@ There is one case where we do some amount of eager unification. If you have an e between two regions 'a = 'b - + we will record that fact in a unification table. You can then use `opportunistic_resolve_var` to convert `'b` to `'a` (or vice versa). This is sometimes needed to ensure termination of fixed-point