Skip to content

Commit ca4fcbd

Browse files
committed
Add lots of date-check annotations
Also added dates for things that previously said "as of now" or "as of this writing" and cleaned up a couple of things along the way.
1 parent 1cda8c1 commit ca4fcbd

24 files changed

+118
-112
lines changed

src/backend/backend-agnostic.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
<!-- toc -->
44

5-
As of January 2021, `rustc_codegen_ssa` provides an abstract interface for all backends to
6-
implement, to allow other codegen backends (e.g. [Cranelift]).
5+
As of January 2021 <!-- date: 2021-01 -->, `rustc_codegen_ssa` provides an
6+
abstract interface for all backends to implement, to allow other codegen
7+
backends (e.g. [Cranelift]).
78

89
[Cranelift]: https://github.com/bytecodealliance/wasmtime/tree/HEAD/cranelift
910

src/borrow_check/region_inference/member_constraints.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,13 @@ member constraints come in.
9393

9494
## Choices are always lifetime parameters
9595

96-
At present, the "choice" regions from a member constraint are always
97-
lifetime parameters from the current function. As of January 2021,
98-
this falls out from the placement of impl Trait, though in the future
99-
it may not be the case.
100-
We take some advantage of this fact, as it simplifies the current
101-
code. In particular, we don't have to consider a case like `'0 member
102-
of ['1, 'static]`, in which the value of both `'0` and `'1` are being
103-
inferred and hence changing. See [rust-lang/rust#61773][#61773] for more
104-
information.
96+
At present, the "choice" regions from a member constraint are always lifetime
97+
parameters from the current function. As of January 2021 <!-- date: 2021-01 -->,
98+
this falls out from the placement of impl Trait, though in the future it may not
99+
be the case. We take some advantage of this fact, as it simplifies the current
100+
code. In particular, we don't have to consider a case like `'0 member of ['1,
101+
'static]`, in which the value of both `'0` and `'1` are being inferred and hence
102+
changing. See [rust-lang/rust#61773][#61773] for more information.
105103

106104
[#61773]: https://github.com/rust-lang/rust/issues/61773
107105

src/compiler-src.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
> top-level directory has separate directories for the compiler, build-system,
88
> std libs, etc, rather than one huge `src/` directory.
99
>
10-
> As of January 2021, the std libs have been moved to `library/` and the crates
11-
> that make up the `rustc` compiler itself have been moved to `compiler/`
10+
> As of January 2021 <!-- date: 2021-01 -->, the standard libraries have been
11+
> moved to `library/` and the crates that make up the `rustc` compiler itself
12+
> have been moved to `compiler/`.
1213
1314
Now that we have [seen what the compiler does](./overview.md), let's take a
1415
look at the structure of the contents of the rust-lang/rust repo.
@@ -20,9 +21,9 @@ containing the compiler, the standard libraries (`core`, `alloc`, `std`,
2021
`proc_macro`, etc), and `rustdoc`, along with the build system and a bunch of
2122
tools and submodules for building a full Rust distribution.
2223

23-
As of this writing, this structure is gradually undergoing some transformation
24-
to make it a bit less monolithic and more approachable, especially to
25-
newcomers.
24+
As of August 2020 <!-- date: 2020-08 -->, this structure is gradually undergoing
25+
some transformation to make it a bit less monolithic and more approachable,
26+
especially to newcomers.
2627

2728
The repository consists of three main directories:
2829

src/contributing.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,13 @@ Just a few things to keep in mind:
410410
Aim to provide a reasonable amount of context, possibly including but not limited to:
411411
- A reason for why the data may be out of date other than "change", as change is a constant across
412412
the project.
413-
- A date the comment was added, e.g. instead of writing _"Currently, ..."_ consider writing
413+
- The date the comment was added, e.g. instead of writing _"Currently, ..."_
414+
or _"As of now, ..."_, consider writing
414415
_"As of January 2021, ..."_.
415416
Try to format the date as `<MONTH> <YEAR>` to ease search.
417+
- Additionally, include a machine-readable comment of the form `<!-- date:
418+
2021-01 -->` (if the current month is January 2021). We have an automated
419+
tool that uses these (in `ci/date-check`).
416420
- A link to a relevant WG, tracking issue, `rustc` rustdoc page, or similar, that may provide
417421
further explanation for the change process or a way to verify that the information is not
418422
outdated.

src/diagnostics.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,9 @@ declare_lint! {
594594
}
595595
```
596596

597-
If you need a combination of options that's not supported by the
598-
`declare_lint!` macro, you can always define your own static with a type of
599-
`&Lint` but this is (as of January 2021) linted against in the compiler tree.
597+
If you need a combination of options that's not supported by the `declare_lint!`
598+
macro, you can always define your own static with a type of `&Lint` but this is
599+
(as of January 2021 <!-- date: 2021-01 -->) linted against in the compiler tree.
600600

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

src/diagnostics/lintstore.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ First, we have the lint declarations themselves: this is where the name and defa
1717
other metadata come from. These are normally defined by way of the [`declare_lint!`] macro, which
1818
boils down to a static with type `&rustc_session::lint::Lint`.
1919

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).
20+
As of January 2021 <!-- date: 2021-01 -->, we lint against direct declarations
21+
without the use of the macro today (although this may change in the future, as
22+
the macro is somewhat unwieldy to add new fields to, like all macros by
23+
example).
2324

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

src/git.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ Changes not staged for commit:
144144
no changes added to commit (use "git add" and/or "git commit -a")
145145
```
146146

147-
These changes are not changes to files: they are changes to submodules
148-
(more on this [later](#git-submodules)). To get rid of those, run `git submodule update` (or run any
149-
`x.py` command, which will automatically update the submodules).
150-
Note that there is (as of January 2021) a bug if you use worktrees, submodules, and x.py in a commit
151-
hook.
152-
If you run into an error like:
147+
These changes are not changes to files: they are changes to submodules (more on
148+
this [later](#git-submodules)). To get rid of those, run `git submodule update`
149+
(or run any `x.py` command, which will automatically update the submodules).
150+
Note that there is (as of January 2021 <!-- date: 2021-01 -->) a bug if you use
151+
worktrees, submodules, and x.py in a commit hook. If you run into an error
152+
like:
153153

154154
```
155155
error: failed to read `/home/joshua/rustc-worktree/src/tools/miri/cargo-miri/Cargo.toml`

src/llvm-coverage-instrumentation.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,15 @@ properly-configured variables in LLVM IR, according to very specific
221221
details of the [_LLVM Coverage Mapping Format_][coverage-mapping-format]
222222
(Version 4).[^llvm-and-covmap-versions]
223223

224-
[^llvm-and-covmap-versions]: The Rust compiler (as of January 2021) supports
225-
_LLVM Coverage Mapping Format_ Version 4 (the most up-to-date version
226-
of the format, at the time of this writing) for improved compatibility
227-
with other LLVM-based compilers (like _Clang_), and to take advantage
228-
of some format optimizations. Version 4 was introduced in _LLVM 11_,
229-
which is currently the default LLVM version for Rust. Note that the
230-
Rust compiler optionally supports some earlier LLVM versions,
231-
prior to _LLVM 11_. If `rustc` is configured to use an incompatible
232-
version of LLVM, compiling with `-Z instrument-coverage` will
233-
generate an error message.
224+
[^llvm-and-covmap-versions]: The Rust compiler (as of January 2021 <!-- date:
225+
2021-01 -->) supports _LLVM Coverage Mapping Format_ Version 4 (the most
226+
up-to-date version of the format, at the time of this writing) for improved
227+
compatibility with other LLVM-based compilers (like _Clang_), and to take
228+
advantage of some format optimizations. Version 4 was introduced in _LLVM 11_,
229+
which is currently the default LLVM version for Rust. Note that the Rust
230+
compiler optionally supports some earlier LLVM versions, prior to _LLVM 11_. If
231+
`rustc` is configured to use an incompatible version of LLVM, compiling with `-Z
232+
instrument-coverage` will generate an error message.
234233

235234
```rust
236235
pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {

src/miri.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,13 @@ concrete integer.
193193

194194
However, a variable of pointer or reference *type*, such as `*const T` or `&T`,
195195
does not have to have a pointer *value*: it could be obtaining by casting or
196-
transmuting an integer to a pointer (as of January 2021 that is hard to do in const eval,
197-
but eventually `transmute` will be stable as a `const fn`). And similarly, when
198-
casting or transmuting a reference to some actual allocation to an integer, we
199-
end up with a pointer *value* (`Scalar::Ptr`) at integer *type* (`usize`). This
200-
is a problem because we cannot meaningfully perform integer operations such as
201-
division on pointer values.
196+
transmuting an integer to a pointer (as of January 2021 <!-- date: 2021-01 -->
197+
that is hard to do in const eval, but eventually `transmute` will be stable as a
198+
`const fn`). And similarly, when casting or transmuting a reference to some
199+
actual allocation to an integer, we end up with a pointer *value*
200+
(`Scalar::Ptr`) at integer *type* (`usize`). This is a problem because we
201+
cannot meaningfully perform integer operations such as division on pointer
202+
values.
202203

203204
## Interpretation
204205

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ 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 (as of January 2021)
18-
express that type by using the opaque type in a "defining use site".
17+
Since there needs to be a concrete background type, you can (as of January 2021
18+
<!-- date: 2021-01 -->) express that type by using the opaque type in a
19+
"defining use site".
1920

2021
```rust,ignore
2122
struct Struct;

src/overview.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ to remain to ensure that unreachable functions still have their errors emitted.
247247
[passes]: https://github.com/rust-lang/rust/blob/45ebd5808afd3df7ba842797c0fcd4447ddf30fb/src/librustc_interface/passes.rs#L824
248248

249249
Moreover, the compiler wasn't originally built to use a query system; the query
250-
system has been retrofitted into the compiler, so parts of it are not
251-
query-fied yet. Also, LLVM isn't our code, so that isn't querified
252-
either. The plan is to eventually query-fy all of the steps listed in the
253-
previous section, but as of this writing, only the steps between HIR and
254-
LLVM-IR are query-fied. That is, lexing and parsing are done all at once for
255-
the whole program.
250+
system has been retrofitted into the compiler, so parts of it are not query-fied
251+
yet. Also, LLVM isn't our code, so that isn't querified either. The plan is to
252+
eventually query-fy all of the steps listed in the previous section, but as of
253+
April 2020 <!-- date: 2020-04 -->, only the steps between HIR and LLVM-IR are
254+
query-fied. That is, lexing and parsing are done all at once for the whole
255+
program.
256256

257257
One other thing to mention here is the all-important "typing context",
258258
[`TyCtxt`], which is a giant struct that is at the center of all things.

src/parallel-rustc.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Most of the compiler is not parallel. This represents an opportunity for
44
improving compiler performance.
55

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.
6+
As of January 2021 <!-- date: 2021-01 -->, work on explicitly parallelizing the
7+
compiler has stalled. There is a lot of design and correctness work that needs
8+
to be done.
89

910
One can try out the current parallel compiler work by enabling it in the
1011
`config.toml`.
@@ -21,9 +22,9 @@ There are a few basic ideas in this effort:
2122

2223
[`rayon`]: https://crates.io/crates/rayon
2324

24-
As of this writing, much of this effort is on hold due to lack of manpower. We
25-
have a working prototype with promising performance gains in many cases.
26-
However, there are two blockers:
25+
As of May 2020 <!-- date: 2020-05 -->, much of this effort is on hold due to
26+
lack of manpower. We have a working prototype with promising performance gains
27+
in many cases. However, there are two blockers:
2728

2829
- It's not clear what invariants need to be upheld that might not hold in the
2930
face of concurrency. An auditing effort was underway, but seems to have

src/profiling.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ codegen-units = 0 # num_cpus
8888
The llvm-lines output is affected by several options.
8989
`optimize = false` increases it from 2.1GB to 3.5GB and `codegen-units = 0` to 4.1GB.
9090

91-
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z mir-opt-level=1"`,
92-
level 0 adds 0.3GB and level 2 removes 0.2GB.
93-
As of January 2021, inlining currently only happens in LLVM but this might change in the future.
94-
91+
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z
92+
mir-opt-level=1"`, level 0 adds 0.3GB and level 2 removes 0.2GB. As of January
93+
2021 <!-- date: 2021-01 -->, inlining currently only happens in LLVM but this
94+
might change in the future.

src/queries/profiling.md

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

9191
- **Timed passes:** Green boxes, when present (via `-Z time-passes`), represent
92-
_timed passes_ in the compiler. As of January 2021 these passes are not queries, but may be
93-
replaced by queries in future versions.
92+
_timed passes_ in the compiler. As of January 2021 <!-- date: 2021-01 -->
93+
these passes are not queries, but may be replaced by queries in future versions.
9494
- **Labels:** Some green and red boxes are labeled with text. Where they are
9595
present, the labels give the following information:
9696
- The [query's _provider_](#queries), sans its _key_ and its _result_, which

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ 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.
7878

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.
79+
As of January 2021 <!-- date: 2021-01 -->, this input data consists mainly of
80+
the HIR map, upstream crate metadata, and the command-line options the compiler
81+
was invoked with; but in the future inputs will just consist of command-line
82+
options and a list of source files -- the HIR map will itself be provided by a
83+
query which processes these source files.
8384

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

src/query.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# Queries: demand-driven compilation
22

3-
As described in [the high-level overview of the compiler][hl], the
4-
Rust compiler is still (as of January 2021) transitioning from a traditional "pass-based"
5-
setup to a "demand-driven" system. **The Compiler Query System is the
6-
key to our new demand-driven organization.** The idea is pretty
7-
simple. You have various queries that compute things about the input
8-
– for example, there is a query called `type_of(def_id)` that, given
9-
the [def-id] of some item, will compute the type of that item and return
10-
it to you.
3+
As described in [the high-level overview of the compiler][hl], the Rust compiler
4+
is still (as of January 2021 <!-- date: 2021-01 -->) transitioning from a
5+
traditional "pass-based" setup to a "demand-driven" system. **The Compiler Query
6+
System is the key to our new demand-driven organization.** The idea is pretty
7+
simple. You have various queries that compute things about the input – for
8+
example, there is a query called `type_of(def_id)` that, given the [def-id] of
9+
some item, will compute the type of that item and return it to you.
1110

1211
[def-id]: appendix/glossary.md#def-id
13-
[hl]: compiler-src.html
12+
[hl]: ./compiler-src.md
1413

1514
Query execution is **memoized** – so the first time you invoke a
1615
query, it will go do the computation, but the next time, the result is

src/rustdoc-internals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ these passes, please let us know!)
6666

6767
[44136]: https://github.com/rust-lang/rust/issues/44136
6868

69-
Here is current (as of this writing) list of passes:
69+
Here is the list of passes as of March 2018 <!-- date: 2018-03 -->:
7070

7171
- `propagate-doc-cfg` - propagates `#[doc(cfg(...))]` to child items.
7272
- `collapse-docs` concatenates all document attributes into one document

src/salsa.md

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

12-
> As of January 2021, although Salsa is inspired by (among other things) rustc's query system,
13-
> it is not used directly in rustc.
14-
> It _is_ used in chalk and extensively in `rust-analyzer`, but there are no medium or long-term
15-
> concrete plans to integrate it into the compiler.
12+
> As of January 2021 <!-- date: 2021-01 -->, although Salsa is inspired by
13+
> (among other things) rustc's query system, it is not used directly in rustc.
14+
> It _is_ used in chalk and extensively in `rust-analyzer`, but there are no
15+
> medium or long-term concrete plans to integrate it into the compiler.
1616
1717
## What is Salsa?
1818

src/tests/adding.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -333,17 +333,17 @@ The error levels that you can have are:
333333
1. `ERROR`
334334
2. `WARNING`
335335
3. `NOTE`
336-
4. `HELP` and `SUGGESTION`*
336+
4. `HELP` and `SUGGESTION`[^sugg-placement]
337337

338-
\* **Note**: `SUGGESTION` must follow immediately after `HELP`.
338+
[^sugg-placement]: **Note**: `SUGGESTION` must follow immediately after `HELP`.
339339

340340
## Revisions
341341

342-
Certain classes of tests support "revisions" (as of the time of this
343-
writing, this includes compile-fail, run-fail, and
344-
incremental, though incremental tests are somewhat
345-
different). Revisions allow a single test file to be used for multiple
346-
tests. This is done by adding a special header at the top of the file:
342+
Certain classes of tests support "revisions" (as of February 2018 <!-- date:
343+
2018-02 -->, this includes compile-fail, run-fail, and incremental, though
344+
incremental tests are somewhat different). Revisions allow a single test file to
345+
be used for multiple tests. This is done by adding a special header at the top
346+
of the file:
347347

348348
```rust
349349
// revisions: foo bar baz

src/tests/intro.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ launch a build that will run all tests on some configurations
123123
(x86_64-gnu-llvm-8 linux. x86_64-gnu-tools linux, mingw-check linux). In
124124
essence, it runs `./x.py test` after building for each of them.
125125

126-
The integration bot [bors] is used for coordinating merges to the master
127-
branch. When a PR is approved, it goes into a [queue] where merges are tested
128-
one at a time on a wide set of platforms using GitHub Actions (as of January 2021 over
129-
50 different configurations). Due to the limit on the number of parallel jobs,
130-
we run CI under the [rust-lang-ci] organization except for PRs.
131-
Most platforms only run the build steps, some run a restricted set of tests,
132-
only a subset run the full suite of tests (see Rust's [platform tiers]).
126+
The integration bot [bors] is used for coordinating merges to the master branch.
127+
When a PR is approved, it goes into a [queue] where merges are tested one at a
128+
time on a wide set of platforms using GitHub Actions (as of January 2021 <!--
129+
date: 2021-01 -->, over 50 different configurations). Due to the limit on the
130+
number of parallel jobs, we run CI under the [rust-lang-ci] organization except
131+
for PRs. Most platforms only run the build steps, some run a restricted set of
132+
tests, only a subset run the full suite of tests (see Rust's [platform tiers]).
133133

134134
[GitHub Actions]: https://github.com/rust-lang/rust/actions
135135
[rust-lang-ci]: https://github.com/rust-lang-ci/rust/actions

src/the-parser.md

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

3-
As of January 2021, the lexer and parser are undergoing refactoring to allow
4-
extracting them into libraries.
3+
As of January 2021 <!-- date: 2021-01 -->, the lexer and parser are undergoing
4+
refactoring to allow 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

0 commit comments

Comments
 (0)