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.
This commit is contained in:
parent
5118b6b865
commit
5e57035110
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
As of January 2021, `rustc_codegen_ssa` provides an abstract interface for all backends to
|
As of January 2021 <!-- date: 2021-01 -->, `rustc_codegen_ssa` provides an
|
||||||
implement, to allow other codegen backends (e.g. [Cranelift]).
|
abstract interface for all backends to implement, to allow other codegen
|
||||||
|
backends (e.g. [Cranelift]).
|
||||||
|
|
||||||
[Cranelift]: https://github.com/bytecodealliance/wasmtime/tree/HEAD/cranelift
|
[Cranelift]: https://github.com/bytecodealliance/wasmtime/tree/HEAD/cranelift
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,15 +93,13 @@ member constraints come in.
|
||||||
|
|
||||||
## Choices are always lifetime parameters
|
## Choices are always lifetime parameters
|
||||||
|
|
||||||
At present, the "choice" regions from a member constraint are always
|
At present, the "choice" regions from a member constraint are always lifetime
|
||||||
lifetime parameters from the current function. As of January 2021,
|
parameters from the current function. As of January 2021 <!-- date: 2021-01 -->,
|
||||||
this falls out from the placement of impl Trait, though in the future
|
this falls out from the placement of impl Trait, though in the future it may not
|
||||||
it may not be the case.
|
be the case. We take some advantage of this fact, as it simplifies the current
|
||||||
We take some advantage of this fact, as it simplifies the current
|
code. In particular, we don't have to consider a case like `'0 member of ['1,
|
||||||
code. In particular, we don't have to consider a case like `'0 member
|
'static]`, in which the value of both `'0` and `'1` are being inferred and hence
|
||||||
of ['1, 'static]`, in which the value of both `'0` and `'1` are being
|
changing. See [rust-lang/rust#61773][#61773] for more information.
|
||||||
inferred and hence changing. See [rust-lang/rust#61773][#61773] for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
[#61773]: https://github.com/rust-lang/rust/issues/61773
|
[#61773]: https://github.com/rust-lang/rust/issues/61773
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,9 @@
|
||||||
> top-level directory has separate directories for the compiler, build-system,
|
> top-level directory has separate directories for the compiler, build-system,
|
||||||
> std libs, etc, rather than one huge `src/` directory.
|
> std libs, etc, rather than one huge `src/` directory.
|
||||||
>
|
>
|
||||||
> As of January 2021, the std libs have been moved to `library/` and the crates
|
> As of January 2021 <!-- date: 2021-01 -->, the standard libraries have been
|
||||||
> that make up the `rustc` compiler itself have been moved to `compiler/`
|
> moved to `library/` and the crates that make up the `rustc` compiler itself
|
||||||
|
> have been moved to `compiler/`.
|
||||||
|
|
||||||
Now that we have [seen what the compiler does](./overview.md), let's take a
|
Now that we have [seen what the compiler does](./overview.md), let's take a
|
||||||
look at the structure of the contents of the rust-lang/rust repo.
|
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`,
|
||||||
`proc_macro`, etc), and `rustdoc`, along with the build system and a bunch of
|
`proc_macro`, etc), and `rustdoc`, along with the build system and a bunch of
|
||||||
tools and submodules for building a full Rust distribution.
|
tools and submodules for building a full Rust distribution.
|
||||||
|
|
||||||
As of this writing, this structure is gradually undergoing some transformation
|
As of August 2020 <!-- date: 2020-08 -->, this structure is gradually undergoing
|
||||||
to make it a bit less monolithic and more approachable, especially to
|
some transformation to make it a bit less monolithic and more approachable,
|
||||||
newcomers.
|
especially to newcomers.
|
||||||
|
|
||||||
The repository consists of three main directories:
|
The repository consists of three main directories:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -410,9 +410,13 @@ Just a few things to keep in mind:
|
||||||
Aim to provide a reasonable amount of context, possibly including but not limited to:
|
Aim to provide a reasonable amount of context, possibly including but not limited to:
|
||||||
- A reason for why the data may be out of date other than "change", as change is a constant across
|
- A reason for why the data may be out of date other than "change", as change is a constant across
|
||||||
the project.
|
the project.
|
||||||
- A date the comment was added, e.g. instead of writing _"Currently, ..."_ consider writing
|
- The date the comment was added, e.g. instead of writing _"Currently, ..."_
|
||||||
|
or _"As of now, ..."_, consider writing
|
||||||
_"As of January 2021, ..."_.
|
_"As of January 2021, ..."_.
|
||||||
Try to format the date as `<MONTH> <YEAR>` to ease search.
|
Try to format the date as `<MONTH> <YEAR>` to ease search.
|
||||||
|
- Additionally, include a machine-readable comment of the form `<!-- date:
|
||||||
|
2021-01 -->` (if the current month is January 2021). We have an automated
|
||||||
|
tool that uses these (in `ci/date-check`).
|
||||||
- A link to a relevant WG, tracking issue, `rustc` rustdoc page, or similar, that may provide
|
- A link to a relevant WG, tracking issue, `rustc` rustdoc page, or similar, that may provide
|
||||||
further explanation for the change process or a way to verify that the information is not
|
further explanation for the change process or a way to verify that the information is not
|
||||||
outdated.
|
outdated.
|
||||||
|
|
|
||||||
|
|
@ -594,9 +594,9 @@ declare_lint! {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If you need a combination of options that's not supported by the
|
If you need a combination of options that's not supported by the `declare_lint!`
|
||||||
`declare_lint!` macro, you can always define your own static with a type of
|
macro, you can always define your own static with a type of `&Lint` but this is
|
||||||
`&Lint` but this is (as of January 2021) linted against in the compiler tree.
|
(as of January 2021 <!-- date: 2021-01 -->) linted against in the compiler tree.
|
||||||
|
|
||||||
<a id="future-incompatible"></a>
|
<a id="future-incompatible"></a>
|
||||||
#### Guidelines for creating a future incompatibility lint
|
#### Guidelines for creating a future incompatibility lint
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,10 @@ First, we have the lint declarations themselves: this is where the name and defa
|
||||||
other metadata come from. These are normally defined by way of the [`declare_lint!`] macro, which
|
other metadata come from. These are normally defined by way of the [`declare_lint!`] macro, which
|
||||||
boils down to a static with type `&rustc_session::lint::Lint`.
|
boils down to a static with type `&rustc_session::lint::Lint`.
|
||||||
|
|
||||||
As of January 2021, we lint against direct declarations without the use of the macro today
|
As of January 2021 <!-- date: 2021-01 -->, we lint against direct declarations
|
||||||
(although this may change in the future, as the macro is somewhat unwieldy to add new fields to,
|
without the use of the macro today (although this may change in the future, as
|
||||||
like all macros by example).
|
the macro is somewhat unwieldy to add new fields to, like all macros by
|
||||||
|
example).
|
||||||
|
|
||||||
Lint declarations don't carry any "state" - they are merely global identifers and descriptions of
|
Lint declarations don't carry any "state" - they are merely global identifers and descriptions of
|
||||||
lints. We assert at runtime that they are not registered twice (by lint name).
|
lints. We assert at runtime that they are not registered twice (by lint name).
|
||||||
|
|
|
||||||
12
src/git.md
12
src/git.md
|
|
@ -144,12 +144,12 @@ Changes not staged for commit:
|
||||||
no changes added to commit (use "git add" and/or "git commit -a")
|
no changes added to commit (use "git add" and/or "git commit -a")
|
||||||
```
|
```
|
||||||
|
|
||||||
These changes are not changes to files: they are changes to submodules
|
These changes are not changes to files: they are changes to submodules (more on
|
||||||
(more on this [later](#git-submodules)). To get rid of those, run `git submodule update` (or run any
|
this [later](#git-submodules)). To get rid of those, run `git submodule update`
|
||||||
`x.py` command, which will automatically update the submodules).
|
(or run any `x.py` command, which will automatically update the submodules).
|
||||||
Note that there is (as of January 2021) a bug if you use worktrees, submodules, and x.py in a commit
|
Note that there is (as of January 2021 <!-- date: 2021-01 -->) a bug if you use
|
||||||
hook.
|
worktrees, submodules, and x.py in a commit hook. If you run into an error
|
||||||
If you run into an error like:
|
like:
|
||||||
|
|
||||||
```
|
```
|
||||||
error: failed to read `/home/joshua/rustc-worktree/src/tools/miri/cargo-miri/Cargo.toml`
|
error: failed to read `/home/joshua/rustc-worktree/src/tools/miri/cargo-miri/Cargo.toml`
|
||||||
|
|
|
||||||
|
|
@ -221,16 +221,15 @@ properly-configured variables in LLVM IR, according to very specific
|
||||||
details of the [_LLVM Coverage Mapping Format_][coverage-mapping-format]
|
details of the [_LLVM Coverage Mapping Format_][coverage-mapping-format]
|
||||||
(Version 4).[^llvm-and-covmap-versions]
|
(Version 4).[^llvm-and-covmap-versions]
|
||||||
|
|
||||||
[^llvm-and-covmap-versions]: The Rust compiler (as of January 2021) supports
|
[^llvm-and-covmap-versions]: The Rust compiler (as of January 2021 <!-- date:
|
||||||
_LLVM Coverage Mapping Format_ Version 4 (the most up-to-date version
|
2021-01 -->) supports _LLVM Coverage Mapping Format_ Version 4 (the most
|
||||||
of the format, at the time of this writing) for improved compatibility
|
up-to-date version of the format, at the time of this writing) for improved
|
||||||
with other LLVM-based compilers (like _Clang_), and to take advantage
|
compatibility with other LLVM-based compilers (like _Clang_), and to take
|
||||||
of some format optimizations. Version 4 was introduced in _LLVM 11_,
|
advantage of some format optimizations. Version 4 was introduced in _LLVM 11_,
|
||||||
which is currently the default LLVM version for Rust. Note that the
|
which is currently the default LLVM version for Rust. Note that the Rust
|
||||||
Rust compiler optionally supports some earlier LLVM versions,
|
compiler optionally supports some earlier LLVM versions, prior to _LLVM 11_. If
|
||||||
prior to _LLVM 11_. If `rustc` is configured to use an incompatible
|
`rustc` is configured to use an incompatible version of LLVM, compiling with `-Z
|
||||||
version of LLVM, compiling with `-Z instrument-coverage` will
|
instrument-coverage` will generate an error message.
|
||||||
generate an error message.
|
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
|
pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
|
||||||
|
|
|
||||||
13
src/miri.md
13
src/miri.md
|
|
@ -193,12 +193,13 @@ concrete integer.
|
||||||
|
|
||||||
However, a variable of pointer or reference *type*, such as `*const T` or `&T`,
|
However, a variable of pointer or reference *type*, such as `*const T` or `&T`,
|
||||||
does not have to have a pointer *value*: it could be obtaining by casting or
|
does not have to have a pointer *value*: it could be obtaining by casting or
|
||||||
transmuting an integer to a pointer (as of January 2021 that is hard to do in const eval,
|
transmuting an integer to a pointer (as of January 2021 <!-- date: 2021-01 -->
|
||||||
but eventually `transmute` will be stable as a `const fn`). And similarly, when
|
that is hard to do in const eval, but eventually `transmute` will be stable as a
|
||||||
casting or transmuting a reference to some actual allocation to an integer, we
|
`const fn`). And similarly, when casting or transmuting a reference to some
|
||||||
end up with a pointer *value* (`Scalar::Ptr`) at integer *type* (`usize`). This
|
actual allocation to an integer, we end up with a pointer *value*
|
||||||
is a problem because we cannot meaningfully perform integer operations such as
|
(`Scalar::Ptr`) at integer *type* (`usize`). This is a problem because we
|
||||||
division on pointer values.
|
cannot meaningfully perform integer operations such as division on pointer
|
||||||
|
values.
|
||||||
|
|
||||||
## Interpretation
|
## Interpretation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,9 @@ This declares an opaque type named `Foo`, of which the only information is that
|
||||||
it implements `Bar`. Therefore, any of `Bar`'s interface can be used on a `Foo`,
|
it implements `Bar`. Therefore, any of `Bar`'s interface can be used on a `Foo`,
|
||||||
but nothing else (regardless of whether it implements any other traits).
|
but nothing else (regardless of whether it implements any other traits).
|
||||||
|
|
||||||
Since there needs to be a concrete background type, you can (as of January 2021)
|
Since there needs to be a concrete background type, you can (as of January 2021
|
||||||
express that type by using the opaque type in a "defining use site".
|
<!-- date: 2021-01 -->) express that type by using the opaque type in a
|
||||||
|
"defining use site".
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
struct Struct;
|
struct Struct;
|
||||||
|
|
|
||||||
|
|
@ -247,12 +247,12 @@ to remain to ensure that unreachable functions still have their errors emitted.
|
||||||
[passes]: https://github.com/rust-lang/rust/blob/45ebd5808afd3df7ba842797c0fcd4447ddf30fb/src/librustc_interface/passes.rs#L824
|
[passes]: https://github.com/rust-lang/rust/blob/45ebd5808afd3df7ba842797c0fcd4447ddf30fb/src/librustc_interface/passes.rs#L824
|
||||||
|
|
||||||
Moreover, the compiler wasn't originally built to use a query system; the query
|
Moreover, the compiler wasn't originally built to use a query system; the query
|
||||||
system has been retrofitted into the compiler, so parts of it are not
|
system has been retrofitted into the compiler, so parts of it are not query-fied
|
||||||
query-fied yet. Also, LLVM isn't our code, so that isn't querified
|
yet. Also, LLVM isn't our code, so that isn't querified either. The plan is to
|
||||||
either. The plan is to eventually query-fy all of the steps listed in the
|
eventually query-fy all of the steps listed in the previous section, but as of
|
||||||
previous section, but as of this writing, only the steps between HIR and
|
April 2020 <!-- date: 2020-04 -->, only the steps between HIR and LLVM-IR are
|
||||||
LLVM-IR are query-fied. That is, lexing and parsing are done all at once for
|
query-fied. That is, lexing and parsing are done all at once for the whole
|
||||||
the whole program.
|
program.
|
||||||
|
|
||||||
One other thing to mention here is the all-important "typing context",
|
One other thing to mention here is the all-important "typing context",
|
||||||
[`TyCtxt`], which is a giant struct that is at the center of all things.
|
[`TyCtxt`], which is a giant struct that is at the center of all things.
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
Most of the compiler is not parallel. This represents an opportunity for
|
Most of the compiler is not parallel. This represents an opportunity for
|
||||||
improving compiler performance.
|
improving compiler performance.
|
||||||
|
|
||||||
As of January 2021, work on explicitly parallelizing the compiler has stalled.
|
As of January 2021 <!-- date: 2021-01 -->, work on explicitly parallelizing the
|
||||||
There is a lot of design and correctness work that needs to be done.
|
compiler has stalled. There is a lot of design and correctness work that needs
|
||||||
|
to be done.
|
||||||
|
|
||||||
One can try out the current parallel compiler work by enabling it in the
|
One can try out the current parallel compiler work by enabling it in the
|
||||||
`config.toml`.
|
`config.toml`.
|
||||||
|
|
@ -21,9 +22,9 @@ There are a few basic ideas in this effort:
|
||||||
|
|
||||||
[`rayon`]: https://crates.io/crates/rayon
|
[`rayon`]: https://crates.io/crates/rayon
|
||||||
|
|
||||||
As of this writing, much of this effort is on hold due to lack of manpower. We
|
As of May 2020 <!-- date: 2020-05 -->, much of this effort is on hold due to
|
||||||
have a working prototype with promising performance gains in many cases.
|
lack of manpower. We have a working prototype with promising performance gains
|
||||||
However, there are two blockers:
|
in many cases. However, there are two blockers:
|
||||||
|
|
||||||
- It's not clear what invariants need to be upheld that might not hold in the
|
- It's not clear what invariants need to be upheld that might not hold in the
|
||||||
face of concurrency. An auditing effort was underway, but seems to have
|
face of concurrency. An auditing effort was underway, but seems to have
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ codegen-units = 0 # num_cpus
|
||||||
The llvm-lines output is affected by several options.
|
The llvm-lines output is affected by several options.
|
||||||
`optimize = false` increases it from 2.1GB to 3.5GB and `codegen-units = 0` to 4.1GB.
|
`optimize = false` increases it from 2.1GB to 3.5GB and `codegen-units = 0` to 4.1GB.
|
||||||
|
|
||||||
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z mir-opt-level=1"`,
|
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z
|
||||||
level 0 adds 0.3GB and level 2 removes 0.2GB.
|
mir-opt-level=1"`, level 0 adds 0.3GB and level 2 removes 0.2GB. As of January
|
||||||
As of January 2021, inlining currently only happens in LLVM but this might change in the future.
|
2021 <!-- date: 2021-01 -->, inlining currently only happens in LLVM but this
|
||||||
|
might change in the future.
|
||||||
|
|
|
||||||
|
|
@ -89,8 +89,8 @@ The trace of the queries has a formal structure; see
|
||||||
We style this formal structure as follows:
|
We style this formal structure as follows:
|
||||||
|
|
||||||
- **Timed passes:** Green boxes, when present (via `-Z time-passes`), represent
|
- **Timed passes:** Green boxes, when present (via `-Z time-passes`), represent
|
||||||
_timed passes_ in the compiler. As of January 2021 these passes are not queries, but may be
|
_timed passes_ in the compiler. As of January 2021 <!-- date: 2021-01 -->
|
||||||
replaced by queries in future versions.
|
these passes are not queries, but may be replaced by queries in future versions.
|
||||||
- **Labels:** Some green and red boxes are labeled with text. Where they are
|
- **Labels:** Some green and red boxes are labeled with text. Where they are
|
||||||
present, the labels give the following information:
|
present, the labels give the following information:
|
||||||
- The [query's _provider_](#queries), sans its _key_ and its _result_, which
|
- The [query's _provider_](#queries), sans its _key_ and its _result_, which
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,11 @@ executed, no results are cached. But the context already provides access to
|
||||||
"input" data, i.e. pieces of immutable data that were computed before the
|
"input" data, i.e. pieces of immutable data that were computed before the
|
||||||
context was created and that queries can access to do their computations.
|
context was created and that queries can access to do their computations.
|
||||||
|
|
||||||
As of January 2021, this input data consists mainly of the HIR map, upstream crate metadata, and the
|
As of January 2021 <!-- date: 2021-01 -->, this input data consists mainly of
|
||||||
command-line options the compiler was invoked with; but in the future inputs will just consist of
|
the HIR map, upstream crate metadata, and the command-line options the compiler
|
||||||
command-line options and a list of source files -- the HIR map will itself be provided by a query
|
was invoked with; but in the future inputs will just consist of command-line
|
||||||
which processes these source files.
|
options and a list of source files -- the HIR map will itself be provided by a
|
||||||
|
query which processes these source files.
|
||||||
|
|
||||||
Without inputs, queries would live in a void without anything to compute their
|
Without inputs, queries would live in a void without anything to compute their
|
||||||
result from (remember, query providers only have access to other queries and
|
result from (remember, query providers only have access to other queries and
|
||||||
|
|
|
||||||
17
src/query.md
17
src/query.md
|
|
@ -1,16 +1,15 @@
|
||||||
# Queries: demand-driven compilation
|
# Queries: demand-driven compilation
|
||||||
|
|
||||||
As described in [the high-level overview of the compiler][hl], the
|
As described in [the high-level overview of the compiler][hl], the Rust compiler
|
||||||
Rust compiler is still (as of January 2021) transitioning from a traditional "pass-based"
|
is still (as of January 2021 <!-- date: 2021-01 -->) transitioning from a
|
||||||
setup to a "demand-driven" system. **The Compiler Query System is the
|
traditional "pass-based" setup to a "demand-driven" system. **The Compiler Query
|
||||||
key to our new demand-driven organization.** The idea is pretty
|
System is the key to our new demand-driven organization.** The idea is pretty
|
||||||
simple. You have various queries that compute things about the input
|
simple. You have various queries that compute things about the input – for
|
||||||
– for example, there is a query called `type_of(def_id)` that, given
|
example, there is a query called `type_of(def_id)` that, given the [def-id] of
|
||||||
the [def-id] of some item, will compute the type of that item and return
|
some item, will compute the type of that item and return it to you.
|
||||||
it to you.
|
|
||||||
|
|
||||||
[def-id]: appendix/glossary.md#def-id
|
[def-id]: appendix/glossary.md#def-id
|
||||||
[hl]: compiler-src.html
|
[hl]: ./compiler-src.md
|
||||||
|
|
||||||
Query execution is **memoized** – so the first time you invoke a
|
Query execution is **memoized** – so the first time you invoke a
|
||||||
query, it will go do the computation, but the next time, the result is
|
query, it will go do the computation, but the next time, the result is
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ these passes, please let us know!)
|
||||||
|
|
||||||
[44136]: https://github.com/rust-lang/rust/issues/44136
|
[44136]: https://github.com/rust-lang/rust/issues/44136
|
||||||
|
|
||||||
Here is current (as of this writing) list of passes:
|
Here is the list of passes as of March 2018 <!-- date: 2018-03 -->:
|
||||||
|
|
||||||
- `propagate-doc-cfg` - propagates `#[doc(cfg(...))]` to child items.
|
- `propagate-doc-cfg` - propagates `#[doc(cfg(...))]` to child items.
|
||||||
- `collapse-docs` concatenates all document attributes into one document
|
- `collapse-docs` concatenates all document attributes into one document
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@ want to watch [Salsa In More
|
||||||
Depth](https://www.youtube.com/watch?v=i_IhACacPRY), also by Niko
|
Depth](https://www.youtube.com/watch?v=i_IhACacPRY), also by Niko
|
||||||
Matsakis.
|
Matsakis.
|
||||||
|
|
||||||
> As of January 2021, although Salsa is inspired by (among other things) rustc's query system,
|
> As of January 2021 <!-- date: 2021-01 -->, although Salsa is inspired by
|
||||||
> it is not used directly in rustc.
|
> (among other things) rustc's query system, it is not used directly in rustc.
|
||||||
> It _is_ used in chalk and extensively in `rust-analyzer`, but there are no medium or long-term
|
> It _is_ used in chalk and extensively in `rust-analyzer`, but there are no
|
||||||
> concrete plans to integrate it into the compiler.
|
> medium or long-term concrete plans to integrate it into the compiler.
|
||||||
|
|
||||||
## What is Salsa?
|
## What is Salsa?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -333,17 +333,17 @@ The error levels that you can have are:
|
||||||
1. `ERROR`
|
1. `ERROR`
|
||||||
2. `WARNING`
|
2. `WARNING`
|
||||||
3. `NOTE`
|
3. `NOTE`
|
||||||
4. `HELP` and `SUGGESTION`*
|
4. `HELP` and `SUGGESTION`[^sugg-placement]
|
||||||
|
|
||||||
\* **Note**: `SUGGESTION` must follow immediately after `HELP`.
|
[^sugg-placement]: **Note**: `SUGGESTION` must follow immediately after `HELP`.
|
||||||
|
|
||||||
## Revisions
|
## Revisions
|
||||||
|
|
||||||
Certain classes of tests support "revisions" (as of the time of this
|
Certain classes of tests support "revisions" (as of February 2018 <!-- date:
|
||||||
writing, this includes compile-fail, run-fail, and
|
2018-02 -->, this includes compile-fail, run-fail, and incremental, though
|
||||||
incremental, though incremental tests are somewhat
|
incremental tests are somewhat different). Revisions allow a single test file to
|
||||||
different). Revisions allow a single test file to be used for multiple
|
be used for multiple tests. This is done by adding a special header at the top
|
||||||
tests. This is done by adding a special header at the top of the file:
|
of the file:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
// revisions: foo bar baz
|
// revisions: foo bar baz
|
||||||
|
|
|
||||||
|
|
@ -124,13 +124,13 @@ launch a build that will run all tests on some configurations
|
||||||
(x86_64-gnu-llvm-8 linux. x86_64-gnu-tools linux, mingw-check linux). In
|
(x86_64-gnu-llvm-8 linux. x86_64-gnu-tools linux, mingw-check linux). In
|
||||||
essence, it runs `./x.py test` after building for each of them.
|
essence, it runs `./x.py test` after building for each of them.
|
||||||
|
|
||||||
The integration bot [bors] is used for coordinating merges to the master
|
The integration bot [bors] is used for coordinating merges to the master branch.
|
||||||
branch. When a PR is approved, it goes into a [queue] where merges are tested
|
When a PR is approved, it goes into a [queue] where merges are tested one at a
|
||||||
one at a time on a wide set of platforms using GitHub Actions (as of January 2021 over
|
time on a wide set of platforms using GitHub Actions (as of January 2021 <!--
|
||||||
50 different configurations). Due to the limit on the number of parallel jobs,
|
date: 2021-01 -->, over 50 different configurations). Due to the limit on the
|
||||||
we run CI under the [rust-lang-ci] organization except for PRs.
|
number of parallel jobs, we run CI under the [rust-lang-ci] organization except
|
||||||
Most platforms only run the build steps, some run a restricted set of tests,
|
for PRs. Most platforms only run the build steps, some run a restricted set of
|
||||||
only a subset run the full suite of tests (see Rust's [platform tiers]).
|
tests, only a subset run the full suite of tests (see Rust's [platform tiers]).
|
||||||
|
|
||||||
[GitHub Actions]: https://github.com/rust-lang/rust/actions
|
[GitHub Actions]: https://github.com/rust-lang/rust/actions
|
||||||
[rust-lang-ci]: https://github.com/rust-lang-ci/rust/actions
|
[rust-lang-ci]: https://github.com/rust-lang-ci/rust/actions
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Lexing and Parsing
|
# Lexing and Parsing
|
||||||
|
|
||||||
As of January 2021, the lexer and parser are undergoing refactoring to allow
|
As of January 2021 <!-- date: 2021-01 -->, the lexer and parser are undergoing
|
||||||
extracting them into libraries.
|
refactoring to allow extracting them into libraries.
|
||||||
|
|
||||||
The very first thing the compiler does is take the program (in Unicode
|
The very first thing the compiler does is take the program (in Unicode
|
||||||
characters) and turn it into something the compiler can work with more
|
characters) and turn it into something the compiler can work with more
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
# Chalk-based trait solving
|
# Chalk-based trait solving
|
||||||
|
|
||||||
[Chalk][chalk] is an experimental trait solver for rust that is (as of January 2021)
|
[Chalk][chalk] is an experimental trait solver for Rust that is (as of January
|
||||||
under development by the [Traits Working Group][wg]. Its goal is
|
2021 <!-- date: 2021-01 -->) under development by the [Traits Working
|
||||||
to enable a lot of trait system features and bug fixes that are
|
Group][wg]. Its goal is to enable a lot of trait system features and bug fixes
|
||||||
hard to implement (e.g. GATs or specialization). If you
|
that are hard to implement (e.g. GATs or specialization). If you would like to
|
||||||
would like to help in hacking on the new solver, you will find
|
help in hacking on the new solver, you will find instructions for getting
|
||||||
instructions for getting involved in the
|
involved in the [Traits Working Group tracking issue][wg].
|
||||||
[Traits Working Group tracking issue][wg].
|
|
||||||
|
|
||||||
[wg]: https://github.com/rust-lang/rust/issues/48416
|
[wg]: https://github.com/rust-lang/rust/issues/48416
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,11 +118,11 @@ candidate that is definitively applicable. In some cases, we may not
|
||||||
know whether an impl/where-clause applies or not – this occurs when
|
know whether an impl/where-clause applies or not – this occurs when
|
||||||
the obligation contains unbound inference variables.
|
the obligation contains unbound inference variables.
|
||||||
|
|
||||||
The subroutines that decide whether a particular impl/where-clause/etc
|
The subroutines that decide whether a particular impl/where-clause/etc applies
|
||||||
applies to a particular obligation are collectively referred to as the
|
to a particular obligation are collectively referred to as the process of
|
||||||
process of _matching_. As of January 2021, this amounts to
|
_matching_. As of January 2021 <!-- date: 2021-01 -->, this amounts to unifying
|
||||||
unifying the `Self` types, but in the future we may also recursively
|
the `Self` types, but in the future we may also recursively consider some of the
|
||||||
consider some of the nested obligations, in the case of an impl.
|
nested obligations, in the case of an impl.
|
||||||
|
|
||||||
**TODO**: what does "unifying the `Self` types" mean? The `Self` of the
|
**TODO**: what does "unifying the `Self` types" mean? The `Self` of the
|
||||||
obligation with that of an impl?
|
obligation with that of an impl?
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ inference works, or perhaps this blog post on
|
||||||
|
|
||||||
[Unification in the Chalk project]: http://smallcultfollowing.com/babysteps/blog/2017/03/25/unification-in-chalk-part-1/
|
[Unification in the Chalk project]: http://smallcultfollowing.com/babysteps/blog/2017/03/25/unification-in-chalk-part-1/
|
||||||
|
|
||||||
All told, the inference context stores four kinds of inference variables as of
|
All told, the inference context stores four kinds of inference variables (as of
|
||||||
this writing:
|
January 2018 <!-- date: 2018-01 -->):
|
||||||
|
|
||||||
- Type variables, which come in three varieties:
|
- Type variables, which come in three varieties:
|
||||||
- General type variables (the most common). These can be unified with any
|
- General type variables (the most common). These can be unified with any
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue