Skip to content

Commit 213db93

Browse files
committed
Fixes #924 Add context to dated information
1 parent ed72105 commit 213db93

15 files changed

+53
-44
lines changed

src/SUMMARY.md

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
- [Lowering to logic](./traits/lowering-to-logic.md)
108108
- [Goals and clauses](./traits/goals-and-clauses.md)
109109
- [Canonical queries](./traits/canonical-queries.md)
110-
- [Lowering module in rustc](./traits/lowering-module.md)
111110
- [Type checking](./type-checking.md)
112111
- [Method Lookup](./method-lookup.md)
113112
- [Variance](./variance.md)

src/about-this-guide.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,25 @@ There are six parts to this guide:
3030
[p5]: ./part-5-intro.md
3131
[app]: ./appendix/background.md
3232

33-
The Guide itself is of course open-source as well, and the sources can
34-
be found at the [GitHub repository]. If you find any mistakes in the
35-
guide, please file an issue about it, or even better, open a PR
36-
with a correction!
33+
### Constant change
34+
35+
Keep in mind that `rustc` is a real production-quality product, being worked upon continuously by a
36+
sizeable set of contributors.
37+
As such, it has its fair share of codebase churn and technical debt.
38+
In addition, many of the ideas discussed throughout this guide are idealized designs that are not
39+
fully realized yet.
40+
All this makes keeping this guide completely up to date on everything very hard!
41+
42+
The Guide itself is of course open-source as well, and the sources can be found at the
43+
[GitHub repository].
44+
If you find any mistakes in the guide, please file an issue about it, or even better, open a PR with
45+
a correction!
46+
47+
If you do contribute to the guide, please see the corresponding
48+
[subsection on writing documentation](contributing.md#writing-documentation).
49+
50+
> “‘All conditioned things are impermanent’ — when one sees this with wisdom, one turns away from
51+
> suffering.” _The Dhammapada, verse 277_
3752
3853
## Other places to find information
3954

src/backend/backend-agnostic.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Backend Agnostic Codegen
22

3-
In the future, it would be nice to allow other codegen backends (e.g.
4-
[Cranelift]). To this end, `rustc_codegen_ssa` provides an
5-
abstract interface for all backends to implement.
3+
As of January 2021, `rustc_codegen_ssa` provides an abstract interface for all backends to
4+
implement, to allow other codegen backends (e.g. [Cranelift]).
65

76
[Cranelift]: https://github.com/bytecodealliance/wasmtime/tree/HEAD/cranelift
87

src/borrow_check/region_inference/member_constraints.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ member constraints come in.
9292
## Choices are always lifetime parameters
9393

9494
At present, the "choice" regions from a member constraint are always
95-
lifetime parameters from the current function. This falls out from the
96-
placement of impl Trait, though in the future it may not be the case.
95+
lifetime parameters from the current function. As of January 2021,
96+
this falls out from the placement of impl Trait, though in the future
97+
it may not be the case.
9798
We take some advantage of this fact, as it simplifies the current
9899
code. In particular, we don't have to consider a case like `'0 member
99100
of ['1, 'static]`, in which the value of both `'0` and `'1` are being

src/contributing.md

+5
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ repo][rdgrepo]. The issue tracker in that repo is also a great way to find
407407
things that need doing. There are issues for beginners and advanced compiler
408408
devs alike!
409409

410+
When contributing text to the guide, please contextualize the information in some time period.
411+
E.g. instead of writing _"Currently, ..."_, or _"In the future, ..."_, consider writing
412+
_"As of January 2021, ..."_.
413+
414+
410415
[rdg]: https://rustc-dev-guide.rust-lang.org/
411416
[rdgrepo]: https://github.com/rust-lang/rustc-dev-guide
412417

src/diagnostics/lintstore.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ Unfortunately, a lot of the documentation we have refers to both of these as jus
1515

1616
First, we have the lint declarations themselves: this is where the name and default lint level and
1717
other metadata come from. These are normally defined by way of the [`declare_lint!`] macro, which
18-
boils down to a static with type `&rustc_session::lint::Lint`. We lint against direct declarations
19-
without the use of the macro today (though this may change in the future, as the macro is somewhat
20-
unwieldy to add new fields to, like all macros by example).
18+
boils down to a static with type `&rustc_session::lint::Lint`.
19+
20+
As of January 2021, we lint against direct declarations without the use of the macro today
21+
(although this may change in the future, as the macro is somewhat unwieldy to add new fields to,
22+
like all macros by example).
2123

2224
Lint declarations don't carry any "state" - they are merely global identifers and descriptions of
2325
lints. We assert at runtime that they are not registered twice (by lint name).

src/overview.md

-12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ So first, let's look at what the compiler does to your code. For now, we will
1515
avoid mentioning how the compiler implements these steps except as needed;
1616
we'll talk about that later.
1717

18-
1918
- The compile process begins when a user writes a Rust source program in text
2019
and invokes the `rustc` compiler on it. The work that the compiler needs to
2120
perform is defined by command-line options. For example, it is possible to
@@ -159,17 +158,6 @@ satisfy/optimize for. For example,
159158
So, as you read through the rest of the guide, keep these things in mind. They
160159
will often inform decisions that we make.
161160

162-
### Constant change
163-
164-
Keep in mind that `rustc` is a real production-quality product.
165-
As such, it has its fair share of codebase churn and technical debt. A lot of
166-
the designs discussed throughout this guide are idealized designs that are not
167-
fully realized yet. And things keep changing so that it is hard to keep this
168-
guide completely up to date on everything!
169-
170-
The compiler definitely has rough edges, but because of its design it is able
171-
to keep up with the requirements above.
172-
173161
### Intermediate representations
174162

175163
As with most compilers, `rustc` uses some intermediate representations (IRs) to

src/parallel-rustc.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Parallel Compilation
22

33
Most of the compiler is not parallel. This represents an opportunity for
4-
improving compiler performance. Much effort has been put into parallelizing
5-
`rustc`, but it is still pretty early days for this work. There is a lot of
6-
design and correctness work that needs to be done.
4+
improving compiler performance.
5+
6+
As of January 2021, work on explicitly parallelizing the compiler has stalled.
7+
There is a lot of design and correctness work that needs to be done.
78

89
One can try out the current parallel compiler work by enabling it in the
910
`config.toml`.

src/profiling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ The llvm-lines output is affected by several options.
9090

9191
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z mir-opt-level=1"`,
9292
level 0 adds 0.3GB and level 2 removes 0.2GB.
93-
Inlining currently only happens in LLVM, but this might change in the future.
93+
As of January 2021, inlining currently only happens in LLVM but this might change in the future.
9494

src/queries/profiling.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ The trace of the queries has a formal structure; see
8686
We style this formal structure as follows:
8787

8888
- **Timed passes:** Green boxes, when present (via `-Z time-passes`), represent
89-
_timed passes_ in the compiler. In future versions, these passes may be
90-
replaced by queries, explained below.
89+
_timed passes_ in the compiler. As of January 2021 these passes are not queries, but may be
90+
replaced by queries in future versions.
9191
- **Labels:** Some green and red boxes are labeled with text. Where they are
9292
present, the labels give the following information:
9393
- The [query's _provider_](#queries), sans its _key_ and its _result_, which

src/queries/query-evaluation-model-in-detail.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ When the query context is created, it is still empty: No queries have been
7575
executed, no results are cached. But the context already provides access to
7676
"input" data, i.e. pieces of immutable data that were computed before the
7777
context was created and that queries can access to do their computations.
78-
Currently this input data consists mainly of the HIR map, upstream crate
79-
metadata, and the command-line
80-
options the compiler was invoked with. In the future, inputs will just consist
81-
of command-line options and a list of source files -- the HIR map will itself
82-
be provided by a query which processes these source files.
78+
79+
As of January 2021, this input data consists mainly of the HIR map, upstream crate metadata, and the
80+
command-line options the compiler was invoked with; but in the future inputs will just consist of
81+
command-line options and a list of source files -- the HIR map will itself be provided by a query
82+
which processes these source files.
8383

8484
Without inputs, queries would live in a void without anything to compute their
8585
result from (remember, query providers only have access to other queries and

src/salsa.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ want to watch [Salsa In More
77
Depth](https://www.youtube.com/watch?v=i_IhACacPRY), also by Niko
88
Matsakis.
99

10-
> Salsa is not used directly in rustc, but it is used extensively for
11-
> rust-analyzer and may be integrated into the compiler in the future.
10+
> As of January 2021, although Salsa is inspired by (among other things9 rustc's query system,
11+
> it is not used directly in rustc.
12+
> It _is_ used in chalk, and extensively in `rust-analyzer`, but there no medium or long-term
13+
> concrete plans to integrate it into the compiler.
1214
1315
## What is Salsa?
1416

src/the-parser.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Lexing and Parsing
22

3-
> The parser and lexer are currently undergoing a lot of refactoring, so parts
4-
> of this chapter may be out of date.
3+
As of January 2021, the lexer and parser are undergoing refactoring to allow
4+
extracting them into libraries.
55

66
The very first thing the compiler does is take the program (in Unicode
77
characters) and turn it into something the compiler can work with more

src/traits/lowering-module.md

-3
This file was deleted.

src/traits/resolution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ the obligation contains unbound inference variables.
118118

119119
The subroutines that decide whether a particular impl/where-clause/etc
120120
applies to a particular obligation are collectively referred to as the
121-
process of _matching_. At the moment, this amounts to
121+
process of _matching_. As of January 2021, 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.
124124

0 commit comments

Comments
 (0)