Skip to content

Commit 0a5bb7f

Browse files
igarayJoshua Nelson
and
Joshua Nelson
authored
Add context to dated information (#1013)
* Fixes #924 Add context to dated information * Fixes #924 Addressed comments and some uses of 'currently' * Update src/contributing.md Co-authored-by: Joshua Nelson <joshua@yottadb.com> * Update src/salsa.md Co-authored-by: Joshua Nelson <joshua@yottadb.com> * Fixes #924 Addressed comments * Fixes #924 Fixed line lengths. Co-authored-by: Joshua Nelson <joshua@yottadb.com>
1 parent e7ac2ff commit 0a5bb7f

25 files changed

+90
-67
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

+21-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,27 @@ 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 in this guide].
49+
50+
[subsection on writing documentation in this guide]: contributing.md#contributing-to-rustc-dev-guide.
51+
52+
> “‘All conditioned things are impermanent’ — when one sees this with wisdom, one turns away from
53+
> suffering.” _The Dhammapada, verse 277_
3754
3855
## Other places to find information
3956

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

+22-5
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,28 @@ You can also use `rustdoc` directly to check small fixes. For example,
401401
`rustdoc src/doc/reference.md` will render reference to `doc/reference.html`.
402402
The CSS might be messed up, but you can verify that the HTML is right.
403403

404-
Additionally, contributions to the [rustc-dev-guide][rdg] are always welcome.
405-
Contributions can be made directly at [the rust-lang/rustc-dev-guide
406-
repo][rdgrepo]. The issue tracker in that repo is also a great way to find
407-
things that need doing. There are issues for beginners and advanced compiler
408-
devs alike!
404+
### Contributing to rustc-dev-guide
405+
406+
Contributions to the [rustc-dev-guide][rdg] are always welcome, and can be made directly at
407+
[the rust-lang/rustc-dev-guide repo][rdgrepo].
408+
The issue tracker in that repo is also a great way to find things that need doing.
409+
There are issues for beginners and advanced compiler devs alike!
410+
411+
Just a few things to keep in mind:
412+
413+
- Please limit line length to 100 characters. This is enforced by CI, and you can run the checks
414+
locally with `ci/check_line_lengths.sh`.
415+
- When contributing text to the guide, please contextualize the information with some time period
416+
and/or a reason so that the reader knows how much to trust or mistrust the information.
417+
Aim to provide a reasonable amount of context, possibly including but not limited to:
418+
- A reason for why the data may be out of date other than "change", as change is a constant across
419+
the project.
420+
- A date the comment was added, e.g. instead of writing _"Currently, ..."_ consider writing
421+
_"As of January 2021, ..."_.
422+
Try to format the date as `<MONTH> <YEAR>` to ease search.
423+
- A link to a relevant WG, tracking issue, `rustc` rustdoc page, or similar, that may provide
424+
further explanation for the change process or a way to verify that the information is not
425+
outdated.
409426

410427
[rdg]: https://rustc-dev-guide.rust-lang.org/
411428
[rdgrepo]: https://github.com/rust-lang/rustc-dev-guide

src/debugging-support-in-rustc.md

-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ document so there is no duplication etc.?
9393

9494
### LLDB
9595

96-
We have our own fork of LLDB - [https://github.com/rust-lang/lldb]
97-
9896
Fork of LLVM project - [https://github.com/rust-lang/llvm-project]
9997

10098
LLDB currently only works on macOS because of a dependency issue. This issue was easier to

src/diagnostics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ declare_lint! {
594594

595595
If you need a combination of options that's not supported by the
596596
`declare_lint!` macro, you can always define your own static with a type of
597-
`&Lint` but this is currently linted against in the compiler tree.
597+
`&Lint` but this is (as of January 2021) linted against in the compiler tree.
598598

599599
<a id="future-incompatible"></a>
600600
#### Guidelines for creating a future incompatibility lint

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/git.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ no changes added to commit (use "git add" and/or "git commit -a")
145145
These changes are not changes to files: they are changes to submodules
146146
(more on this [later](#git-submodules)). To get rid of those, run `git submodule update` (or run any
147147
`x.py` command, which will automatically update the submodules).
148-
Note that there is currently a bug if you use worktrees, submodules, and x.py in a commit hook.
148+
Note that there is (as of January 2021) a bug if you use worktrees, submodules, and x.py in a commit
149+
hook.
149150
If you run into an error like:
151+
150152
```
151153
error: failed to read `/home/joshua/rustc-worktree/src/tools/miri/cargo-miri/Cargo.toml`
152154
@@ -202,7 +204,7 @@ rebase. The section between `<<<<<<< HEAD` and `=======` has the code from
202204
master, while the other side has your version of the code. You'll need to
203205
decide how to deal with the conflict. You may want to keep your changes,
204206
keep the changes on master, or combine the two.
205-
207+
206208
Generally, resolving the conflict consists of two steps: First, fix the
207209
particular conflict. Edit the file to make the changes you want and remove the
208210
`<<<<<<<`, `=======` and `>>>>>>>` lines in the process. Second, check the
@@ -311,7 +313,7 @@ This is because, like any dependency, we want to be able to control which versio
311313
Submodules allow us to do just that: every submodule is "pinned" to a certain
312314
commit, which doesn't change unless modified manually. If you use `git checkout <commit>`
313315
in the `miri` directory and go back to the `rust` directory, you can stage this
314-
change like any
316+
change like any
315317
This is usually done by
316318
the maintainers of the project, and looks like [this][miri-update].
317319

src/llvm-coverage-instrumentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ properly-configured variables in LLVM IR, according to very specific
219219
details of the [_LLVM Coverage Mapping Format_][coverage-mapping-format]
220220
(Version 4).[^llvm-and-covmap-versions]
221221

222-
[^llvm-and-covmap-versions]: The Rust compiler currently supports
222+
[^llvm-and-covmap-versions]: The Rust compiler (as of January 2021) supports
223223
_LLVM Coverage Mapping Format_ Version 4 (the most up-to-date version
224224
of the format, at the time of this writing) for improved compatibility
225225
with other LLVM-based compilers (like _Clang_), and to take advantage

src/miri.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ concrete integer.
191191

192192
However, a variable of pointer or reference *type*, such as `*const T` or `&T`,
193193
does not have to have a pointer *value*: it could be obtaining by casting or
194-
transmuting an integer to a pointer (currently that is hard to do in const eval,
194+
transmuting an integer to a pointer (as of January 2021 that is hard to do in const eval,
195195
but eventually `transmute` will be stable as a `const fn`). And similarly, when
196196
casting or transmuting a reference to some actual allocation to an integer, we
197197
end up with a pointer *value* (`Scalar::Ptr`) at integer *type* (`usize`). This

src/opaque-types-type-alias-impl-trait.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This declares an opaque type named `Foo`, of which the only information is that
1414
it implements `Bar`. Therefore, any of `Bar`'s interface can be used on a `Foo`,
1515
but nothing else (regardless of whether it implements any other traits).
1616

17-
Since there needs to be a concrete background type, you can currently
17+
Since there needs to be a concrete background type, you can (as of January 2021)
1818
express that type by using the opaque type in a "defining use site".
1919

2020
```rust,ignore

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/incremental-compilation-in-detail.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ This comes with a whole new set of implementation challenges:
207207
Fixed-sized, plain-old-data is preferred to complex things that need to run
208208
through an expensive (de-)serialization step.
209209

210-
The following sections describe how the compiler currently solves these issues.
210+
The following sections describe how the compiler solves these issues.
211211

212212
### A Question Of Stability: Bridging The Gap Between Compilation Sessions
213213

src/queries/profiling.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
In an effort to support _incremental compilation_, the latest design of the Rust
33
compiler consists of a _query-based_ model.
44

5-
The details of this model are (currently) outside the scope of this document,
5+
The details of this model are outside the scope of this document,
66
however, we explain [some background of this model](#background), in an effort
77
to explain how we profile its performance. We intend this profiling effort to
88
address [issue 42678](https://github.com/rust-lang/rust/issues/42678).
@@ -50,7 +50,7 @@ This command will generate the following files:
5050

5151
- This additional flag will add all timed passes to the output files mentioned
5252
above, in step 2. As described below, these passes appear visually distinct
53-
from the queries in the HTML output (they currently appear as green boxes, via
53+
from the queries in the HTML output (they appear as green boxes, via
5454
CSS).
5555

5656
### 4. Inspect the output
@@ -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
@@ -111,7 +111,7 @@ Heuristics-based CSS Classes:
111111

112112
- `important` -- Trace nodes are `important` if they have an extent of 6 (or
113113
more), _or_ they have a duration fraction of one percent (or more). These
114-
numbers are simple heuristics (currently hard-coded, but easy to modify).
114+
numbers are simple heuristics (hard-coded, but easy to modify).
115115
Important nodes are styled with textual labels, and highlighted borders (light
116116
red, and bolded).
117117

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/query.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Queries: demand-driven compilation
22

33
As described in [the high-level overview of the compiler][hl], the
4-
Rust compiler is currently transitioning from a traditional "pass-based"
4+
Rust compiler is still (as of January 2021) transitioning from a traditional "pass-based"
55
setup to a "demand-driven" system. **The Compiler Query System is the
66
key to our new demand-driven organization.** The idea is pretty
77
simple. You have various queries that compute things about the input

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 things) 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 are no medium or long-term
13+
> concrete plans to integrate it into the compiler.
1214
1315
## What is Salsa?
1416

src/tests/intro.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ essence, it runs `./x.py test` after building for each of them.
123123

124124
The integration bot [bors] is used for coordinating merges to the master
125125
branch. When a PR is approved, it goes into a [queue] where merges are tested
126-
one at a time on a wide set of platforms using GitHub Actions (currently over
126+
one at a time on a wide set of platforms using GitHub Actions (as of January 2021 over
127127
50 different configurations). Due to the limit on the number of parallel jobs,
128128
we run CI under the [rust-lang-ci] organization except for PRs.
129129
Most platforms only run the build steps, some run a restricted set of tests,

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/chalk.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Chalk-based trait solving
22

3-
[Chalk][chalk] is an experimental trait solver for rust that is currently
3+
[Chalk][chalk] is an experimental trait solver for rust that is (as of January 2021)
44
under development by the [Traits Working Group][wg]. Its goal is
55
to enable a lot of trait system features and bug fixes that are
6-
currently hard to implement (e.g. GATs or specialization). if you
6+
hard to implement (e.g. GATs or specialization). If you
77
would like to help in hacking on the new solver, you will find
88
instructions for getting involved in the
99
[Traits Working Group tracking issue][wg].
@@ -28,7 +28,7 @@ You can read more about chalk itself in the
2828
[Chalk book](https://rust-lang.github.io/chalk/book/) section.
2929

3030
## Ongoing work
31-
The design of the new-style trait solving currently happens in two places:
31+
The design of the new-style trait solving happens in two places:
3232

3333
**chalk**. The [chalk][chalk] repository is where we experiment with new ideas
3434
and designs for the trait system.

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)