Skip to content

Commit c4708f8

Browse files
committed
Traits: Improve index layout, add chalk blurb
1 parent 9ae8422 commit c4708f8

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

src/traits/index.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
# Trait solving (new-style)
22

3-
🚧 This chapter describes "new-style" trait solving. This is still in the
4-
[process of being implemented][wg]; this chapter serves as a kind of
5-
in-progress design document. If you would prefer to read about how the
6-
current trait solver works, check out
7-
[this other chapter](./resolution.html). (By the way, if you
8-
would like to help in hacking on the new solver, you will find
9-
instructions for getting involved in the
10-
[Traits Working Group tracking issue][wg].) 🚧
3+
> 🚧 This chapter describes "new-style" trait solving. This is still in the
4+
> [process of being implemented][wg]; this chapter serves as a kind of
5+
> in-progress design document. If you would prefer to read about how the
6+
> current trait solver works, check out
7+
> [this other chapter](./resolution.html). 🚧
8+
>
9+
> By the way, if you would like to help in hacking on the new solver, you will
10+
> find instructions for getting involved in the
11+
> [Traits Working Group tracking issue][wg].
1112
1213
[wg]: https://github.com/rust-lang/rust/issues/48416
1314

14-
Trait solving is based around a few key ideas:
15+
The new-style trait solver is based on the work done in [chalk][chalk]. Chalk
16+
recasts Rust's trait system explicitly in terms of logic programming. It does
17+
this by "lowering" Rust code into a kind of logic program we can then execute
18+
queries against.
19+
20+
You can read more about chalk itself in the
21+
[Overview of Chalk](./chalk-overview.md) section.
22+
23+
Trait solving in rustc is based around a few key ideas:
1524

1625
- [Lowering to logic](./lowering-to-logic.html), which expresses
1726
Rust traits in terms of standard logical terms.
@@ -32,17 +41,23 @@ Trait solving is based around a few key ideas:
3241
`Bar`?") once, and then apply that same result independently in many
3342
different inference contexts.
3443

35-
Note: this is not a complete list of topics. See the sidebar for more.
44+
> This is not a complete list of topics. See the sidebar for more.
3645
46+
## Ongoing work
3747
The design of the new-style trait solving currently happens in two places:
38-
* The [chalk][chalk] repository is where we experiment with new ideas and
39-
designs for the trait system. It basically consists of a unit testing framework
40-
for the correctness and feasibility of the logical rules defining the new-style
41-
trait system. It also provides the [`chalk_engine`][chalk_engine] crate, which
42-
defines the new-style trait solver used both in the unit testing framework and
43-
in rustc.
44-
* Once we are happy with the logical rules, we proceed to implementing them in
45-
rustc. This mainly happens in [`librustc_traits`][librustc_traits].
48+
49+
**chalk**. The [chalk][chalk] repository is where we experiment with new ideas
50+
and designs for the trait system. It primarily consists of two parts:
51+
* a unit testing framework
52+
for the correctness and feasibility of the logical rules defining the
53+
new-style trait system.
54+
* the [`chalk_engine`][chalk_engine] crate, which
55+
defines the new-style trait solver used both in the unit testing framework
56+
and in rustc.
57+
58+
**rustc**. Once we are happy with the logical rules, we proceed to
59+
implementing them in rustc. This mainly happens in
60+
[`librustc_traits`][librustc_traits].
4661

4762
[chalk]: https://github.com/rust-lang-nursery/chalk
4863
[chalk_engine]: https://github.com/rust-lang-nursery/chalk/tree/master/chalk-engine

0 commit comments

Comments
 (0)