make date-check lightweight
This avoids having to write the date twice when updating date-check. Before "As of <-- 2022-07 --> July 2022" After "As of July 2022"
This commit is contained in:
parent
7955bb399f
commit
b570c882df
|
|
@ -3,9 +3,10 @@ use std::{
|
||||||
convert::TryInto as _,
|
convert::TryInto as _,
|
||||||
env, fmt, fs,
|
env, fmt, fs,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
str::FromStr,
|
||||||
};
|
};
|
||||||
|
|
||||||
use chrono::{Datelike as _, TimeZone as _, Utc};
|
use chrono::{Datelike as _, Month, TimeZone as _, Utc};
|
||||||
use glob::glob;
|
use glob::glob;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
|
|
@ -36,16 +37,7 @@ impl fmt::Display for Date {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_date_regex() -> Regex {
|
fn make_date_regex() -> Regex {
|
||||||
Regex::new(
|
Regex::new(r"[aA]s of (\w+) (\d{4})").unwrap()
|
||||||
r"(?x) # insignificant whitespace mode
|
|
||||||
<!--\s*
|
|
||||||
[dD]ate:\s*
|
|
||||||
(?P<y>\d{4}) # year
|
|
||||||
-
|
|
||||||
(?P<m>\d{2}) # month
|
|
||||||
\s*-->",
|
|
||||||
)
|
|
||||||
.unwrap()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn collect_dates_from_file(date_regex: &Regex, text: &str) -> Vec<(usize, Date)> {
|
fn collect_dates_from_file(date_regex: &Regex, text: &str) -> Vec<(usize, Date)> {
|
||||||
|
|
@ -57,8 +49,8 @@ fn collect_dates_from_file(date_regex: &Regex, text: &str) -> Vec<(usize, Date)>
|
||||||
(
|
(
|
||||||
cap.get(0).unwrap().range(),
|
cap.get(0).unwrap().range(),
|
||||||
Date {
|
Date {
|
||||||
year: cap["y"].parse().unwrap(),
|
year: cap[2].parse().unwrap(),
|
||||||
month: cap["m"].parse().unwrap(),
|
month: Month::from_str(&cap[1]).unwrap().number_from_month(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
@ -183,20 +175,18 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_date_regex() {
|
fn test_date_regex() {
|
||||||
let regex = make_date_regex();
|
let regex = make_date_regex();
|
||||||
assert!(regex.is_match("foo <!-- date: 2021-01 --> bar"));
|
assert!(regex.is_match("As of July 2022"));
|
||||||
}
|
assert!(regex.is_match("As of Jul 2022"));
|
||||||
|
assert!(regex.is_match("As of july 2022"));
|
||||||
#[test]
|
assert!(regex.is_match("As of jul 2022"));
|
||||||
fn test_date_regex_capitalized() {
|
assert!(regex.is_match("as of jul 2022"));
|
||||||
let regex = make_date_regex();
|
|
||||||
assert!(regex.is_match("foo <!-- Date: 2021-08 --> bar"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_collect_dates_from_file() {
|
fn test_collect_dates_from_file() {
|
||||||
let text = "Test1\n<!-- date: 2021-01 -->\nTest2\nFoo<!-- date: 2021-02 \
|
let text = "Test1\nAs of Jan 2021\nTest2\nAs of Feb 2021 \
|
||||||
-->\nTest3\nTest4\nFoo<!-- date: 2021-03 -->Bar\n<!-- date: 2021-04 \
|
\nTest3\nTest4\nAs of march 2021Bar\nas of apr 2021 \
|
||||||
-->\nTest5\nTest6\nTest7\n<!-- date: \n\n2021-05 -->\nTest8
|
\nTest5\nTest6\nTest7\n\n\nas of may 2021\nTest8
|
||||||
";
|
";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
collect_dates_from_file(&make_date_regex(), text),
|
collect_dates_from_file(&make_date_regex(), text),
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
As of <!-- date: 2021-10 --> October 2021, `rustc_codegen_ssa` provides an
|
As of October 2021, `rustc_codegen_ssa` provides an
|
||||||
abstract interface for all backends to implement, to allow other codegen
|
abstract interface for all backends to implement, to allow other codegen
|
||||||
backends (e.g. [Cranelift]).
|
backends (e.g. [Cranelift]).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ 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 lifetime
|
At present, the "choice" regions from a member constraint are always lifetime
|
||||||
parameters from the current function. As of <!-- date: 2021-10 --> October 2021,
|
parameters from the current function. As of October 2021,
|
||||||
this falls out from the placement of impl Trait, though in the future it may not
|
this falls out from the placement of impl Trait, though in the future it may not
|
||||||
be the case. We take some advantage of this fact, as it simplifies the current
|
be the case. 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 of ['1,
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,14 @@ special config, so this may result in different style from normal [`rustfmt`].
|
||||||
Therefore, formatting this repository using `cargo fmt` is not recommended.
|
Therefore, formatting this repository using `cargo fmt` is not recommended.
|
||||||
|
|
||||||
Instead, formatting should be done using `./x.py fmt`. It's a good habit to run
|
Instead, formatting should be done using `./x.py fmt`. It's a good habit to run
|
||||||
`./x.py fmt` before every commit, as this reduces conflicts later.
|
`./x.py fmt` before every commit, as this reduces conflicts later.
|
||||||
|
|
||||||
Formatting is checked by the `tidy` script. It runs automatically when you do
|
Formatting is checked by the `tidy` script. It runs automatically when you do
|
||||||
`./x.py test` and can be run in isolation with `./x.py fmt --check`.
|
`./x.py test` and can be run in isolation with `./x.py fmt --check`.
|
||||||
|
|
||||||
If you want to use format-on-save in your editor, the pinned version of
|
If you want to use format-on-save in your editor, the pinned version of
|
||||||
`rustfmt` is built under `build/<target>/stage0/bin/rustfmt`. You'll have to
|
`rustfmt` is built under `build/<target>/stage0/bin/rustfmt`. You'll have to
|
||||||
pass the <!-- date: 2022-04 --> `--edition=2021` argument yourself when calling
|
pass the <!-- as of April 2022 --> `--edition=2021` argument yourself when calling
|
||||||
`rustfmt` directly.
|
`rustfmt` directly.
|
||||||
|
|
||||||
[fmt]: https://github.com/rust-dev-tools/fmt-rfcs
|
[fmt]: https://github.com/rust-dev-tools/fmt-rfcs
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ reasons:
|
||||||
- The dependency may have transitive dependencies that have one of the above
|
- The dependency may have transitive dependencies that have one of the above
|
||||||
problems.
|
problems.
|
||||||
|
|
||||||
As of <!-- date: 2022-02 --> February 2022, there is no official policy for vetting
|
As of February 2022, there is no official policy for vetting
|
||||||
new dependencies to the compiler. Generally, new dependencies are not added
|
new dependencies to the compiler. Generally, new dependencies are not added
|
||||||
to the compiler unless there is a good reason to do so.
|
to the compiler unless there is a good reason to do so.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ A new diagnostic item can be added with these two steps:
|
||||||
For the naming conventions of diagnostic items, please refer to
|
For the naming conventions of diagnostic items, please refer to
|
||||||
[*Naming Conventions*](#naming-conventions).
|
[*Naming Conventions*](#naming-conventions).
|
||||||
|
|
||||||
2. As of <!-- date: 2022-02 --> February 2022, diagnostic items in code are
|
2. As of February 2022, diagnostic items in code are
|
||||||
accessed via symbols in [`rustc_span::symbol::sym`]. To add your newly
|
accessed via symbols in [`rustc_span::symbol::sym`]. To add your newly
|
||||||
created diagnostic item simply open the module file and add the name (In
|
created diagnostic item simply open the module file and add the name (In
|
||||||
this case `Cat`) at the correct point in the list.
|
this case `Cat`) at the correct point in the list.
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ default lint level and other metadata come from. These are normally defined by
|
||||||
way of the [`declare_lint!`] macro, which boils down to a static with type
|
way of the [`declare_lint!`] macro, which boils down to a static with type
|
||||||
`&rustc_session::lint::Lint`.
|
`&rustc_session::lint::Lint`.
|
||||||
|
|
||||||
As of <!-- date: 2022-02 --> February 2022, we lint against direct declarations
|
As of February 2022, we lint against direct declarations
|
||||||
without the use of the macro today (although this may change in the future, as
|
without the use of the macro today (although this may change in the future, as
|
||||||
the macro is somewhat unwieldy to add new fields to, like all macros).
|
the macro is somewhat unwieldy to add new fields to, like all macros).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ returned by `Emitter::fluent_bundle`. This bundle is used preferentially when
|
||||||
translating messages, the fallback bundle is only used if the primary bundle is
|
translating messages, the fallback bundle is only used if the primary bundle is
|
||||||
missing a message or not provided.
|
missing a message or not provided.
|
||||||
|
|
||||||
As of <!-- date: 2022-06 --> June 2022, there are no locale bundles
|
As of June 2022, there are no locale bundles
|
||||||
distributed with the compiler, but mechanisms are implemented for loading
|
distributed with the compiler, but mechanisms are implemented for loading
|
||||||
bundles.
|
bundles.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ 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 (more on
|
These changes are not changes to files: they are changes to submodules (more on
|
||||||
this [later](#git-submodules)). To get rid of those, run `git submodule update`
|
this [later](#git-submodules)). To get rid of those, run `git submodule update`
|
||||||
(or run any `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 <!-- date: 2022-02 --> February 2022) a [bug][#77620] if you use
|
Note that there is (as of February 2022) a [bug][#77620] if you use
|
||||||
worktrees, submodules, and `x.py` in a commit hook. If you run into an error
|
worktrees, submodules, and `x.py` in a commit hook. If you run into an error
|
||||||
like:
|
like:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,8 +222,8 @@ 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 6).[^llvm-and-covmap-versions]
|
(Version 6).[^llvm-and-covmap-versions]
|
||||||
|
|
||||||
[^llvm-and-covmap-versions]: The Rust compiler (as of <!-- date: 2021-12 -->
|
[^llvm-and-covmap-versions]: The Rust compiler (as of December 2021)
|
||||||
December 2021) supports _LLVM Coverage Mapping Format_ Version 5 or 6. Version 5
|
supports _LLVM Coverage Mapping Format_ Version 5 or 6. Version 5
|
||||||
was introduced in _LLVM 12_, which is (as of this writing) the minimum LLVM
|
was introduced in _LLVM 12_, which is (as of this writing) the minimum LLVM
|
||||||
version supported by the current version of Rust. Version 6 was introduced in
|
version supported by the current version of Rust. Version 6 was introduced in
|
||||||
_LLVM 13_, which is currently the default LLVM version for Rust. The Rust
|
_LLVM 13_, which is currently the default LLVM version for Rust. The Rust
|
||||||
|
|
|
||||||
|
|
@ -14,9 +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 <!-- date:
|
Since there needs to be a concrete background type,
|
||||||
2021-01 --> January 2021) express that type by using the opaque type in a
|
you can (as of January 2021) express that type
|
||||||
"defining use site".
|
by using the opaque type in a "defining use site".
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
struct Struct;
|
struct Struct;
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ 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 query-fied
|
system has been retrofitted into the compiler, so parts of it are not query-fied
|
||||||
yet. Also, LLVM isn't our code, so that isn't querified either. The plan is to
|
yet. Also, LLVM isn't our code, so that isn't querified either. The plan is to
|
||||||
eventually query-fy all of the steps listed in the previous section,
|
eventually query-fy all of the steps listed in the previous section,
|
||||||
but as of <!-- date: 2021-11 --> November 2021, only the steps between HIR and
|
but as of November 2021, only the steps between HIR and
|
||||||
LLVM IR are query-fied. That is, lexing, parsing, name resolution, and macro
|
LLVM IR are query-fied. That is, lexing, parsing, name resolution, and macro
|
||||||
expansion are done all at once for the whole program.
|
expansion are done all at once for the whole program.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Parallel Compilation
|
# Parallel Compilation
|
||||||
|
|
||||||
As of <!-- date: 2022-05 --> May 2022, The only stage of the compiler
|
As of May 2022, The only stage of the compiler
|
||||||
that is already parallel is codegen. The nightly compiler implements query evaluation,
|
that is already parallel is codegen. The nightly compiler implements query evaluation,
|
||||||
but there is still a lot of work to be done. The lack of parallelism at other stages
|
but there is still a lot of work to be done. The lack of parallelism at other stages
|
||||||
also represents an opportunity for improving compiler performance. One can try out the current
|
also represents an opportunity for improving compiler performance. One can try out the current
|
||||||
|
|
@ -60,7 +60,7 @@ this issue can be found [here][parallel-rustdoc].
|
||||||
|
|
||||||
## Current Status
|
## Current Status
|
||||||
|
|
||||||
As of <!-- date: 2022-05 --> May 2022, work on explicitly parallelizing the
|
As of May 2022, work on explicitly parallelizing the
|
||||||
compiler has stalled. There is a lot of design and correctness work that needs
|
compiler has stalled. There is a lot of design and correctness work that needs
|
||||||
to be done.
|
to be done.
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ These are the basic ideas in the effort to make `rustc` parallel:
|
||||||
|
|
||||||
[`rayon`]: https://crates.io/crates/rayon
|
[`rayon`]: https://crates.io/crates/rayon
|
||||||
|
|
||||||
As of <!-- date: 2022-05 --> May 2022, much of this effort is on hold due
|
As of May 2022, much of this effort is on hold due
|
||||||
to lack of manpower. We have a working prototype with promising performance
|
to lack of manpower. We have a working prototype with promising performance
|
||||||
gains in many cases. However, there are two blockers:
|
gains in many cases. However, there are two blockers:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,6 @@ The llvm-lines output is affected by several options.
|
||||||
|
|
||||||
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z
|
MIR optimizations have little impact. Compared to the default `RUSTFLAGS="-Z
|
||||||
mir-opt-level=1"`, 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 <!-- date: 2022-07 --> July 2022,
|
As of July 2022,
|
||||||
inlining happens in LLVM and GCC codegen backends,
|
inlining happens in LLVM and GCC codegen backends,
|
||||||
missing only in the Cranelift one.
|
missing only in the Cranelift one.
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ 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 <!-- date: 2021-01 --> January 2021, this input data consists mainly of
|
As of January 2021, this input data consists mainly of
|
||||||
the HIR map, upstream crate metadata, and the command-line options the compiler
|
the HIR map, upstream crate metadata, and the command-line options the compiler
|
||||||
was invoked with; but in the future inputs will just consist of command-line
|
was invoked with; but in the future inputs will just consist of command-line
|
||||||
options and a list of source files -- the HIR map will itself be provided by a
|
options and a list of source files -- the HIR map will itself be provided by a
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
As described in [the high-level overview of the compiler][hl], the Rust compiler
|
As described in [the high-level overview of the compiler][hl], the Rust compiler
|
||||||
is still (as of <!-- date: 2021-07 --> July 2021) transitioning from a
|
is still (as of July 2021) transitioning from a
|
||||||
traditional "pass-based" setup to a "demand-driven" system. The compiler query
|
traditional "pass-based" setup to a "demand-driven" system. The compiler query
|
||||||
system is the key to rustc's demand-driven organization.
|
system is the key to rustc's demand-driven organization.
|
||||||
The idea is pretty simple. Instead of entirely independent passes
|
The idea is pretty simple. Instead of entirely independent passes
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
To get diagnostics from the compiler,
|
To get diagnostics from the compiler,
|
||||||
configure `rustc_interface::Config` to output diagnostic to a buffer,
|
configure `rustc_interface::Config` to output diagnostic to a buffer,
|
||||||
and run `TyCtxt.analysis`. The following was tested
|
and run `TyCtxt.analysis`. The following was tested
|
||||||
with <!-- date: 2022-06 --> `nightly-2022-06-05` (See [here][example]
|
with <!-- as of June 2022 --> `nightly-2022-06-05` (See [here][example]
|
||||||
for the complete example):
|
for the complete example):
|
||||||
|
|
||||||
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-getting-diagnostics.rs
|
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-getting-diagnostics.rs
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
## Getting the type of an expression
|
## Getting the type of an expression
|
||||||
|
|
||||||
To get the type of an expression, use the `global_ctxt` to get a `TyCtxt`.
|
To get the type of an expression, use the `global_ctxt` to get a `TyCtxt`.
|
||||||
The following was tested with <!-- date: 2022-06 --> `nightly-2022-06-05`
|
The following was tested with <!-- as of June 2022 --> `nightly-2022-06-05`
|
||||||
(see [here][example] for the complete example):
|
(see [here][example] for the complete example):
|
||||||
|
|
||||||
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-interacting-with-the-ast.rs
|
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/examples/rustc-driver-interacting-with-the-ast.rs
|
||||||
|
|
|
||||||
|
|
@ -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 the list of passes as of <!-- date: 2022-05 --> May 2022:
|
Here is the list of passes as of May 2022:
|
||||||
|
|
||||||
- `calculate-doc-coverage` calculates information used for the `--show-coverage`
|
- `calculate-doc-coverage` calculates information used for the `--show-coverage`
|
||||||
flag.
|
flag.
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ 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 <!-- date: 2022-04 --> April 2022, although Salsa is inspired by
|
> As of April 2022, although Salsa is inspired by
|
||||||
> (among other things) rustc's query system, 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
|
> It _is_ used in chalk and extensively in `rust-analyzer`, but there are no
|
||||||
> medium or long-term concrete plans to integrate it into the compiler.
|
> medium or long-term concrete plans to integrate it into the compiler.
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ fn main() {
|
||||||
|
|
||||||
## Revisions
|
## Revisions
|
||||||
|
|
||||||
Certain classes of tests support "revisions" (as of <!-- date: 2022-07 --> July 2022,
|
Certain classes of tests support "revisions" (as of July 2022,
|
||||||
this includes UI, assembly, codegen, debuginfo, incremental, and rustdoc UI tests,
|
this includes UI, assembly, codegen, debuginfo, incremental, and rustdoc UI tests,
|
||||||
though incremental tests are somewhat different).
|
though incremental tests are somewhat different).
|
||||||
Revisions allow a single test file to be used for multiple tests.
|
Revisions allow a single test file to be used for multiple tests.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Lexing and Parsing
|
# Lexing and Parsing
|
||||||
|
|
||||||
As of <!-- date: 2021-01 --> January 2021, the lexer and parser are undergoing
|
As of January 2021, the lexer and parser are undergoing
|
||||||
refactoring to allow 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
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
The THIR ("Typed High-Level Intermediate Representation"), previously called HAIR for
|
The THIR ("Typed High-Level Intermediate Representation"), previously called HAIR for
|
||||||
"High-Level Abstract IR", is another IR used by rustc that is generated after
|
"High-Level Abstract IR", is another IR used by rustc that is generated after
|
||||||
[type checking]. It is (as of <!-- date: 2022-04 --> April 2022) only used for
|
[type checking]. It is (as of April 2022) only used for
|
||||||
[MIR construction] and [exhaustiveness checking]. There is also
|
[MIR construction] and [exhaustiveness checking]. There is also
|
||||||
[an experimental unsafety checker][thir-unsafeck] that operates on the THIR as a replacement for
|
[an experimental unsafety checker][thir-unsafeck] that operates on the THIR as a replacement for
|
||||||
the current MIR unsafety checker, and can be used instead of the MIR unsafety checker by passing
|
the current MIR unsafety checker, and can be used instead of the MIR unsafety checker by passing
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Chalk-based trait solving
|
# Chalk-based trait solving
|
||||||
|
|
||||||
[Chalk][chalk] is an experimental trait solver for Rust that is (as of <!--
|
[Chalk][chalk] is an experimental trait solver for Rust that is
|
||||||
date: 2022-05 --> May 2022) under development by the [Types team].
|
(as of May 2022) under development by the [Types team].
|
||||||
Its goal is to enable a lot of trait system features and bug fixes
|
Its goal is to enable a lot of trait system features and bug fixes
|
||||||
that are hard to implement (e.g. GATs or specialization). If you would like to
|
that are hard to implement (e.g. GATs or specialization). If you would like to
|
||||||
help in hacking on the new solver, drop by on the rust-lang Zulip in the [`#t-types`]
|
help in hacking on the new solver, drop by on the rust-lang Zulip in the [`#t-types`]
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ the obligation contains unbound inference variables.
|
||||||
|
|
||||||
The subroutines that decide whether a particular impl/where-clause/etc applies
|
The subroutines that decide whether a particular impl/where-clause/etc applies
|
||||||
to a particular obligation are collectively referred to as the process of
|
to a particular obligation are collectively referred to as the process of
|
||||||
_matching_. As of <!-- date: 2022-05 --> May 2022, this amounts to unifying
|
_matching_. As of May 2022, this amounts to unifying
|
||||||
the `Self` types, but in the future we may also recursively consider some of the
|
the `Self` types, but in the future we may also recursively consider some of the
|
||||||
nested obligations, in the case of an impl.
|
nested obligations, in the case of an impl.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ 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 five kinds of inference variables
|
All told, the inference context stores five kinds of inference variables
|
||||||
(as of <!-- date: 2021-06 --> June 2021):
|
(as of June 2021):
|
||||||
|
|
||||||
- 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