Skip to content

Commit 23b025a

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 e15fcfb commit 23b025a

24 files changed

+118
-112
lines changed

src/backend/backend-agnostic.md

Lines changed: 3 additions & 2 deletions
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

Lines changed: 7 additions & 9 deletions
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

Lines changed: 6 additions & 5 deletions
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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 9 additions & 10 deletions
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

Lines changed: 7 additions & 6 deletions
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

Lines changed: 3 additions & 2 deletions
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;

0 commit comments

Comments
 (0)