Skip to content

Commit 2a80033

Browse files
authored
Merge pull request #200 from phansch/fix_typos
Fix typos
2 parents d253f98 + 5ec3e1a commit 2a80033

11 files changed

+21
-21
lines changed

src/appendix/glossary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ codegen unit | when we produce LLVM IR, we group the Rust code into
1414
completeness | completeness is a technical term in type theory. Completeness means that every type-safe program also type-checks. Having both soundness and completeness is very hard, and usually soundness is more important. (see "soundness").
1515
control-flow graph | a representation of the control-flow of a program; see [the background chapter for more](./appendix/background.html#cfg)
1616
CTFE | Compile-Time Function Evaluation. This is the ability of the compiler to evaluate `const fn`s at compile time. This is part of the compiler's constant evaluation system. ([see more](./const-eval.html))
17-
cx | we tend to use "cx" as an abbrevation for context. See also `tcx`, `infcx`, etc.
17+
cx | we tend to use "cx" as an abbreviation for context. See also `tcx`, `infcx`, etc.
1818
DAG | a directed acyclic graph is used during compilation to keep track of dependencies between queries. ([see more](incremental-compilation.html))
1919
data-flow analysis | a static analysis that figures out what properties are true at each point in the control-flow of a program; see [the background chapter for more](./appendix/background.html#dataflow)
2020
DefId | an index identifying a definition (see `librustc/hir/def_id.rs`). Uniquely identifies a `DefPath`.
@@ -34,7 +34,7 @@ inference variable | when doing type or region inference, an "inference va
3434
infcx | the inference context (see `librustc/infer`)
3535
IR | Intermediate Representation. A general term in compilers. During compilation, the code is transformed from raw source (ASCII text) to various IRs. In Rust, these are primarily HIR, MIR, and LLVM IR. Each IR is well-suited for some set of computations. For example, MIR is well-suited for the borrow checker, and LLVM IR is well-suited for codegen because LLVM accepts it.
3636
local crate | the crate currently being compiled.
37-
LTO | Link-Time Optimizations. A set of optimizations offered by LLVM that occur just before the final binary is linked. These include optmizations like removing functions that are never used in the final program, for example. _ThinLTO_ is a variant of LTO that aims to be a bit more scalable and efficient, but possibly sacrifices some optimizations. You may also read issues in the Rust repo about "FatLTO", which is the loving nickname given to non-Thin LTO. LLVM documentation: [here][lto] and [here][thinlto]
37+
LTO | Link-Time Optimizations. A set of optimizations offered by LLVM that occur just before the final binary is linked. These include optimizations like removing functions that are never used in the final program, for example. _ThinLTO_ is a variant of LTO that aims to be a bit more scalable and efficient, but possibly sacrifices some optimizations. You may also read issues in the Rust repo about "FatLTO", which is the loving nickname given to non-Thin LTO. LLVM documentation: [here][lto] and [here][thinlto]
3838
[LLVM] | (actually not an acronym :P) an open-source compiler backend. It accepts LLVM IR and outputs native binaries. Various languages (e.g. Rust) can then implement a compiler front-end that output LLVM IR and use LLVM to compile to all the platforms LLVM supports.
3939
MIR | the Mid-level IR that is created after type-checking for use by borrowck and codegen ([see more](./mir/index.html))
4040
miri | an interpreter for MIR used for constant evaluation ([see more](./miri.html))

src/borrow_check/region_inference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The MIR-based region analysis consists of two major functions:
2323
won't be doing lexical region inference at all.
2424
- `compute_regions`, invoked second: this is given as argument the
2525
results of move analysis. It has the job of computing values for all
26-
the inference variabes that `replace_regions_in_mir` introduced.
26+
the inference variables that `replace_regions_in_mir` introduced.
2727
- To do that, it first runs the [MIR type checker](#mirtypeck). This
2828
is basically a normal type-checker but specialized to MIR, which
2929
is much simpler than full Rust of course. Running the MIR type
@@ -531,7 +531,7 @@ then we have this constraint `V2: V3`, so we wind up having to enlarge
531531
V2 in U2 = {skol(1), skol(2)}
532532
```
533533

534-
Now contraint propagation is done, but when we check the outlives
534+
Now constraint propagation is done, but when we check the outlives
535535
relationships, we find that `V2` includes this new element `skol(1)`,
536536
so we report an error.
537537

src/codegen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ generates an executable binary. rustc uses LLVM for code generation.
1010

1111
## What is LLVM?
1212

13-
All of the preceeding chapters of this guide have one thing in common: we never
13+
All of the preceding chapters of this guide have one thing in common: we never
1414
generated any executable machine code at all! With this chapter, all of that
1515
changes.
1616

@@ -29,14 +29,14 @@ many compiler projects, including the `clang` C compiler and our beloved
2929

3030
LLVM's "format `X`" is called LLVM IR. It is basically assembly code with
3131
additional low-level types and annotations added. These annotations are helpful
32-
for doing optimizations on the LLVM IR and outputed machine code. The end
32+
for doing optimizations on the LLVM IR and outputted machine code. The end
3333
result of all this is (at long last) something executable (e.g. an ELF object
3434
or wasm).
3535

3636
There are a few benefits to using LLVM:
3737

3838
- We don't have to write a whole compiler backend. This reduces implementation
39-
and maintainance burden.
39+
and maintenance burden.
4040
- We benefit from the large suite of advanced optimizations that the LLVM
4141
project has been collecting.
4242
- We automatically can compile Rust to any of the platforms for which LLVM has

src/compiletest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ which make it simple to parse common patterns like simple presence or not
115115
attribute is defined (`has_cfg_prefix()`) and many more. The low-level parsers
116116
are found near the end of the `impl Config` block; be sure to look through them
117117
and their associated parsers immediately above to see how they are used to
118-
avoid writing additional parsing code unneccessarily.
118+
avoid writing additional parsing code unnecessarily.
119119

120120
As a concrete example, here is the implementation for the
121121
`parse_failure_status()` parser, in

src/lowering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sanity checks in `src/librustc/hir/map/hir_id_validator.rs`:
3636
for you so you also get the `HirId`.
3737

3838
If you are creating new `DefId`s, since each `DefId` needs to have a
39-
corresponding `NodeId`, it is adviseable to add these `NodeId`s to the
39+
corresponding `NodeId`, it is advisable to add these `NodeId`s to the
4040
`AST` so you don't have to generate new ones during lowering. This has
4141
the advantage of creating a way to find the `DefId` of something via its
4242
`NodeId`. If lowering needs this `DefId` in multiple places, you can't

src/macro-expansion.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ tokens containing the inside of the example invocation `print foo`, while `ms`
9090
might be the sequence of token (trees) `print $mvar:ident`.
9191

9292
The output of the parser is a `NamedParseResult`, which indicates which of
93-
three cases has occured:
93+
three cases has occurred:
9494

9595
- Success: `tts` matches the given matcher `ms`, and we have produced a binding
9696
from metavariables to the corresponding token trees.
9797
- Failure: `tts` does not match `ms`. This results in an error message such as
9898
"No rule expected token _blah_".
99-
- Error: some fatal error has occured _in the parser_. For example, this happens
100-
if there are more than one pattern match, since that indicates the macro is
101-
ambiguous.
99+
- Error: some fatal error has occurred _in the parser_. For example, this
100+
happens if there are more than one pattern match, since that indicates
101+
the macro is ambiguous.
102102

103103
The full interface is defined [here][code_parse_int].
104104

@@ -112,7 +112,7 @@ the macro parser. This is extremely non-intuitive and self-referential. The code
112112
to parse macro _definitions_ is in
113113
[`src/libsyntax/ext/tt/macro_rules.rs`][code_mr]. It defines the pattern for
114114
matching for a macro definition as `$( $lhs:tt => $rhs:tt );+`. In other words,
115-
a `macro_rules` defintion should have in its body at least one occurence of a
115+
a `macro_rules` definition should have in its body at least one occurrence of a
116116
token tree followed by `=>` followed by another token tree. When the compiler
117117
comes to a `macro_rules` definition, it uses this pattern to match the two token
118118
trees per rule in the definition of the macro _using the macro parser itself_.

src/rustdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
3030

3131
## Cheat sheet
3232

33-
* Use `./x.py build --stage 1 src/libstd src/tools/rustdoc` to make a useable
33+
* Use `./x.py build --stage 1 src/libstd src/tools/rustdoc` to make a usable
3434
rustdoc you can run on other projects.
3535
* Add `src/libtest` to be able to use `rustdoc --test`.
3636
* If you've used `rustup toolchain link local /path/to/build/$TARGET/stage1`

src/tests/running.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ enable it in the `config.toml`, too:
7676
incremental = true
7777
```
7878

79-
Note that incremental compilation will use more disk space than
80-
usual. If disk space is a concern for you, you might want to check the
81-
size of the `build` directory from time to time.
79+
Note that incremental compilation will use more disk space than usual.
80+
If disk space is a concern for you, you might want to check the size
81+
of the `build` directory from time to time.
8282

8383
## Running tests manually
8484

src/traits/canonicalization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ for<T,L,T> { ?0: Foo<'?1, ?2> }
5656

5757
This `for<>` gives some information about each of the canonical
5858
variables within. In this case, each `T` indicates a type variable,
59-
so `?0` and `?2` are types; the `L` indicates a lifetime varibale, so
59+
so `?0` and `?2` are types; the `L` indicates a lifetime variable, so
6060
`?1` is a lifetime. The `canonicalize` method *also* gives back a
6161
`CanonicalVarValues` array OV with the "original values" for each
6262
canonicalized variable:

src/traits/lowering-rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ reference the [domain goals][dg] defined in an earlier section.
1010
## Notation
1111

1212
The nonterminal `Pi` is used to mean some generic *parameter*, either a
13-
named lifetime like `'a` or a type paramter like `A`.
13+
named lifetime like `'a` or a type parameter like `A`.
1414

1515
The nonterminal `Ai` is used to mean some generic *argument*, which
1616
might be a lifetime like `'a` or a type like `Vec<A>`.

src/traits/resolution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ know whether an impl/where-clause applies or not – this occurs when
117117
the obligation contains unbound inference variables.
118118

119119
The subroutines that decide whether a particular impl/where-clause/etc
120-
applies to a particular obligation are collectively refered to as the
120+
applies to a particular obligation are collectively referred to as the
121121
process of _matching_. At the moment, this amounts to
122122
unifying the `Self` types, but in the future we may also recursively
123123
consider some of the nested obligations, in the case of an impl.

0 commit comments

Comments
 (0)