Skip to content

Commit 9ad3a69

Browse files
Alexander Regueiromark-i-m
authored andcommitted
replaced all instances of -- (double hyphen) with - (en-dash)
1 parent ddad2c3 commit 9ad3a69

File tree

9 files changed

+41
-41
lines changed

9 files changed

+41
-41
lines changed

src/high-level-overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ many more. The source for each crate can be found in a directory
1313
like `src/libXXX`, where `XXX` is the crate name.
1414

1515
(NB. The names and divisions of these crates are not set in
16-
stone and may change over time -- for the time being, we tend towards
16+
stone and may change over time for the time being, we tend towards
1717
a finer-grained division to help with compilation time, though as
1818
incremental improves that may change.)
1919

@@ -53,7 +53,7 @@ also contains some amount of the compiler itself, although that is
5353
relatively limited.
5454

5555
Finally, all the crates in the bulge in the middle define the bulk of
56-
the compiler -- they all depend on `rustc`, so that they can make use
56+
the compiler they all depend on `rustc`, so that they can make use
5757
of the various types defined there, and they export public routines
5858
that `rustc_driver` will invoke as needed (more and more, what these
5959
crates export are "query definitions", but those are covered later
@@ -117,9 +117,9 @@ take:
117117
- An important step in processing the HIR is to perform type
118118
checking. This process assigns types to every HIR expression,
119119
for example, and also is responsible for resolving some
120-
"type-dependent" paths, such as field accesses (`x.f` -- we
120+
"type-dependent" paths, such as field accesses (`x.f` we
121121
can't know what field `f` is being accessed until we know the
122-
type of `x`) and associated type references (`T::Item` -- we
122+
type of `x`) and associated type references (`T::Item` we
123123
can't know what type `Item` is until we know what `T` is).
124124
- Type checking creates "side-tables" (`TypeckTables`) that include
125125
the types of expressions, the way to resolve methods, and so forth.

src/hir.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The HIR
22

3-
The HIR -- "High-level IR" -- is the primary IR used in most of
3+
The HIR "High-level IR" is the primary IR used in most of
44
rustc. It is a desugared version of the "abstract syntax tree" (AST)
55
that is generated after parsing, macro expansion, and name resolution
66
have completed. Many parts of HIR resemble Rust surface syntax quite
@@ -91,7 +91,7 @@ with a HIR node.
9191

9292
For example, if you have a `DefId`, and you would like to convert it
9393
to a `NodeId`, you can use `tcx.hir.as_local_node_id(def_id)`. This
94-
returns an `Option<NodeId>` -- this will be `None` if the def-id
94+
returns an `Option<NodeId>` this will be `None` if the def-id
9595
refers to something outside of the current crate (since then it has no
9696
HIR node), but otherwise returns `Some(n)` where `n` is the node-id of
9797
the definition.
@@ -100,7 +100,7 @@ Similarly, you can use `tcx.hir.find(n)` to lookup the node for a
100100
`NodeId`. This returns a `Option<Node<'tcx>>`, where `Node` is an enum
101101
defined in the map; by matching on this you can find out what sort of
102102
node the node-id referred to and also get a pointer to the data
103-
itself. Often, you know what sort of node `n` is -- e.g., if you know
103+
itself. Often, you know what sort of node `n` is e.g., if you know
104104
that `n` must be some HIR expression, you can do
105105
`tcx.hir.expect_expr(n)`, which will extract and return the
106106
`&hir::Expr`, panicking if `n` is not in fact an expression.

src/how-to-build-and-run.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ LLVM version: 4.0
129129
Here are a few other useful x.py commands. We'll cover some of them in detail in other sections:
130130

131131
- Building things:
132-
- `./x.py clean` -- clean up the build directory (`rm -rf build` works too, but then you have to rebuild LLVM)
133-
- `./x.py build --stage 1` -- builds everything using the stage 1 compiler, not just up to libstd
134-
- `./x.py build` -- builds the stage2 compiler
132+
- `./x.py clean` clean up the build directory (`rm -rf build` works too, but then you have to rebuild LLVM)
133+
- `./x.py build --stage 1` builds everything using the stage 1 compiler, not just up to libstd
134+
- `./x.py build` builds the stage2 compiler
135135
- Running tests (see the section [running tests](./running-tests.html) for more details):
136-
- `./x.py test --stage 1 src/libstd` -- runs the `#[test]` tests from libstd
137-
- `./x.py test --stage 1 src/test/run-pass` -- runs the `run-pass` test suite
136+
- `./x.py test --stage 1 src/libstd` runs the `#[test]` tests from libstd
137+
- `./x.py test --stage 1 src/test/run-pass` runs the `run-pass` test suite

src/macro-expansion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ a tree of _tokens_. A _token_ is a single "unit" of the grammar, such as an
3333
identifier (e.g., `foo`) or punctuation (e.g., `=>`). There are also other
3434
special tokens, such as `EOF`, which indicates that there are no more tokens.
3535
Token trees resulting from paired parentheses-like characters (`(`...`)`,
36-
`[`...`]`, and `{`...`}`) -- they include the open and close and all the tokens
36+
`[`...`]`, and `{`...`}`) they include the open and close and all the tokens
3737
in between (we do require that parentheses-like characters be balanced). Having
3838
macro expansion operate on token streams rather than the raw bytes of a source
3939
file abstracts away a lot of complexity. The macro expander (and much of the

src/mir.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ query. Each suite consists of multiple optimizations and
4949
transformations. These suites represent useful intermediate points
5050
where we want to access the MIR for type checking or other purposes:
5151

52-
- `mir_build(D)` -- not a query, but this constructs the initial MIR
53-
- `mir_const(D)` -- applies some simple transformations to make MIR ready for constant evaluation;
54-
- `mir_validated(D)` -- applies some more transformations, making MIR ready for borrow checking;
55-
- `optimized_mir(D)` -- the final state, after all optimizations have been performed.
52+
- `mir_build(D)` not a query, but this constructs the initial MIR
53+
- `mir_const(D)` applies some simple transformations to make MIR ready for constant evaluation;
54+
- `mir_validated(D)` applies some more transformations, making MIR ready for borrow checking;
55+
- `optimized_mir(D)` the final state, after all optimizations have been performed.
5656

5757
### Stealing
5858

5959
The intermediate queries `mir_const()` and `mir_validated()` yield up
6060
a `&'tcx Steal<Mir<'tcx>>`, allocated using
6161
`tcx.alloc_steal_mir()`. This indicates that the result may be
62-
**stolen** by the next suite of optimizations -- this is an
62+
**stolen** by the next suite of optimizations this is an
6363
optimization to avoid cloning the MIR. Attempting to use a stolen
6464
result will cause a panic in the compiler. Therefore, it is important
6565
that you do not read directly from these intermediate queries except as

src/query.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ it to you.
1111

1212
[hl]: high-level-overview.html
1313

14-
Query execution is **memoized** -- so the first time you invoke a
14+
Query execution is **memoized** so the first time you invoke a
1515
query, it will go do the computation, but the next time, the result is
1616
returned from a hashtable. Moreover, query execution fits nicely into
1717
**incremental computation**; the idea is roughly that, when you do a
@@ -98,7 +98,7 @@ message"`. This is basically just a precaution in case you are wrong.
9898

9999
So you may be wondering what happens when you invoke a query
100100
method. The answer is that, for each query, the compiler maintains a
101-
cache -- if your query has already been executed, then, the answer is
101+
cache if your query has already been executed, then, the answer is
102102
simple: we clone the return value out of the cache and return it
103103
(therefore, you should try to ensure that the return types of queries
104104
are cheaply cloneable; insert a `Rc` if necessary).

src/trait-resolution.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ resolved and, if so, how it is to be resolved (via impl, where clause, etc).
7373
The main interface is the `select()` function, which takes an obligation
7474
and returns a `SelectionResult`. There are three possible outcomes:
7575

76-
- `Ok(Some(selection))` -- yes, the obligation can be resolved, and
76+
- `Ok(Some(selection))` yes, the obligation can be resolved, and
7777
`selection` indicates how. If the impl was resolved via an impl,
7878
then `selection` may also indicate nested obligations that are required
7979
by the impl.
8080

81-
- `Ok(None)` -- we are not yet sure whether the obligation can be
81+
- `Ok(None)` we are not yet sure whether the obligation can be
8282
resolved or not. This happens most commonly when the obligation
8383
contains unbound type variables.
8484

85-
- `Err(err)` -- the obligation definitely cannot be resolved due to a
85+
- `Err(err)` the obligation definitely cannot be resolved due to a
8686
type error, or because there are no impls that could possibly apply,
8787
etc.
8888

@@ -95,7 +95,7 @@ Searches for impls/where-clauses/etc that might
9595
possibly be used to satisfy the obligation. Each of those is called
9696
a candidate. To avoid ambiguity, we want to find exactly one
9797
candidate that is definitively applicable. In some cases, we may not
98-
know whether an impl/where-clause applies or not -- this occurs when
98+
know whether an impl/where-clause applies or not this occurs when
9999
the obligation contains unbound inference variables.
100100

101101
The basic idea for candidate assembly is to do a first pass in which
@@ -172,11 +172,11 @@ impl<T:Get> Get for Box<T> {
172172
```
173173

174174
What happens when we invoke `get_it(&box 1_u16)`, for example? In this
175-
case, the `Self` type is `Box<u16>` -- that unifies with both impls,
175+
case, the `Self` type is `Box<u16>` that unifies with both impls,
176176
because the first applies to all types, and the second to all
177177
boxes. In the olden days we'd have called this ambiguous. But what we
178178
do now is do a second *winnowing* pass that considers where clauses
179-
and attempts to remove candidates -- in this case, the first impl only
179+
and attempts to remove candidates in this case, the first impl only
180180
applies if `Box<u16> : Copy`, which doesn't hold. After winnowing,
181181
then, we are left with just one candidate, so we can proceed. There is
182182
a test of this in `src/test/run-pass/traits-conditional-dispatch.rs`.
@@ -326,7 +326,7 @@ to a `TraitRef`. We would then create the `TraitRef` from the impl,
326326
using fresh variables for it's bound regions (and thus getting
327327
`Foo<&'$a isize>`, where `'$a` is the inference variable for `'a`). Next
328328
we relate the two trait refs, yielding a graph with the constraint
329-
that `'0 == '$a`. Finally, we check for skolemization "leaks" -- a
329+
that `'0 == '$a`. Finally, we check for skolemization "leaks" a
330330
leak is basically any attempt to relate a skolemized region to another
331331
skolemized region, or to any region that pre-existed the impl match.
332332
The leak check is done by searching from the skolemized region to find
@@ -457,7 +457,7 @@ and the graph is consulted when propagating defaults down the
457457
specialization hierarchy.
458458

459459
You might expect that the specialization graph would be used during
460-
selection -- i.e., when actually performing specialization. This is
460+
selection i.e., when actually performing specialization. This is
461461
not done for two reasons:
462462

463463
- It's merely an optimization: given a set of candidates that apply,
@@ -476,7 +476,7 @@ not done for two reasons:
476476

477477
Trait impl selection can succeed even when multiple impls can apply,
478478
as long as they are part of the same specialization family. In that
479-
case, it returns a *single* impl on success -- this is the most
479+
case, it returns a *single* impl on success this is the most
480480
specialized impl *known* to apply. However, if there are any inference
481481
variables in play, the returned impl may not be the actual impl we
482482
will use at trans time. Thus, we take special care to avoid projecting

src/ty.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ pub type Ty<'tcx> = &'tcx TyS<'tcx>;
8080

8181
[the HIR]: ./hir.html
8282

83-
You can basically ignore the `TyS` struct -- you will basically never
83+
You can basically ignore the `TyS` struct you will basically never
8484
access it explicitly. We always pass it by reference using the
85-
`Ty<'tcx>` alias -- the only exception I think is to define inherent
85+
`Ty<'tcx>` alias the only exception I think is to define inherent
8686
methods on types. Instances of `TyS` are only ever allocated in one of
8787
the rustc arenas (never e.g. on the stack).
8888

@@ -115,7 +115,7 @@ of type variants. For example:
115115
let array_ty = tcx.mk_array(elem_ty, len * 2);
116116
```
117117

118-
These methods all return a `Ty<'tcx>` -- note that the lifetime you
118+
These methods all return a `Ty<'tcx>` note that the lifetime you
119119
get back is the lifetime of the innermost arena that this `tcx` has
120120
access to. In fact, types are always canonicalized and interned (so we
121121
never allocate exactly the same type twice) and are always allocated
@@ -125,7 +125,7 @@ allocated in the global arena). However, the lifetime `'tcx` is always
125125
a safe approximation, so that is what you get back.
126126

127127
> NB. Because types are interned, it is possible to compare them for
128-
> equality efficiently using `==` -- however, this is almost never what
128+
> equality efficiently using `==` however, this is almost never what
129129
> you want to do unless you happen to be hashing and looking for
130130
> duplicates. This is because often in Rust there are multiple ways to
131131
> represent the same type, particularly once inference is involved. If
@@ -141,10 +141,10 @@ In addition to types, there are a number of other arena-allocated data
141141
structures that you can allocate, and which are found in this
142142
module. Here are a few examples:
143143

144-
- `Substs`, allocated with `mk_substs` -- this will intern a slice of types, often used to
144+
- `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>`
146146
would be represented as a slice `&'tcx [tcx.types.i32, tcx.types.u32]`).
147-
- `TraitRef`, typically passed by value -- a **trait reference**
147+
- `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
150150
would reference the `Display` trait, and the substs would contain

src/type-inference.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function and disposed after it returns.
3535
[ty-readme]: ty.html
3636

3737
Within the closure, the infcx will have the type `InferCtxt<'cx, 'gcx,
38-
'tcx>` for some fresh `'cx` and `'tcx` -- the latter corresponds to
38+
'tcx>` for some fresh `'cx` and `'tcx` the latter corresponds to
3939
the lifetime of this temporary arena, and the `'cx` is the lifetime of
4040
the `InferCtxt` itself. (Again, see [that ty README][ty-readme] for
4141
more details on this setup.)
@@ -47,7 +47,7 @@ created. See `InferCtxtBuilder` for more information.
4747
## Inference variables
4848

4949
The main purpose of the inference context is to house a bunch of
50-
**inference variables** -- these represent types or regions whose precise
50+
**inference variables** these represent types or regions whose precise
5151
value is not yet known, but will be uncovered as we perform type-checking.
5252

5353
If you're familiar with the basic ideas of unification from H-M type
@@ -95,15 +95,15 @@ doing this unification, and in what environment, and the `eq` method
9595
performs the actual equality constraint.
9696

9797
When you equate things, you force them to be precisely equal. Equating
98-
returns a `InferResult` -- if it returns `Err(err)`, then equating
98+
returns a `InferResult` if it returns `Err(err)`, then equating
9999
failed, and the enclosing `TypeError` will tell you what went wrong.
100100

101101
The success case is perhaps more interesting. The "primary" return
102-
type of `eq` is `()` -- that is, when it succeeds, it doesn't return a
102+
type of `eq` is `()` that is, when it succeeds, it doesn't return a
103103
value of any particular interest. Rather, it is executed for its
104104
side-effects of constraining type variables and so forth. However, the
105105
actual return type is not `()`, but rather `InferOk<()>`. The
106-
`InferOk` type is used to carry extra trait obligations -- your job is
106+
`InferOk` type is used to carry extra trait obligations your job is
107107
to ensure that these are fulfilled (typically by enrolling them in a
108108
fulfillment context). See the [trait README] for more background here.
109109

@@ -117,7 +117,7 @@ basic concepts apply as above.
117117
Sometimes you would like to know if it is *possible* to equate two
118118
types without error. You can test that with `infcx.can_eq` (or
119119
`infcx.can_sub` for subtyping). If this returns `Ok`, then equality
120-
is possible -- but in all cases, any side-effects are reversed.
120+
is possible but in all cases, any side-effects are reversed.
121121

122122
Be aware though that the success or failure of these methods is always
123123
**modulo regions**. That is, two types `&'a u32` and `&'b u32` will

0 commit comments

Comments
 (0)