@@ -9,21 +9,19 @@ created in the [`rustc_traits::lowering`][lowering] module.
9
9
## The ` program_clauses_for ` query
10
10
11
11
The main entry point is the ` program_clauses_for ` [ query] , which –
12
- given a def-id – produces a set of Chalk program clauses. These
13
- queries are tested using a
14
- [ dedicated unit-testing mechanism, described below] ( #unit-tests ) . The
12
+ given a def-id – produces a set of Chalk program clauses. The
15
13
query is invoked on a ` DefId ` that identifies something like a trait,
16
14
an impl, or an associated item definition. It then produces and
17
15
returns a vector of program clauses.
18
16
19
17
[ query ] : ../query.html
20
18
21
- <a name =" unit-tests " ></a >
22
-
23
19
## Unit tests
24
20
25
- Unit tests are located in [ ` src/test/ui/chalkify ` ] [ chalkify ] . A good
26
- example test is [ the ` lower_impl ` test] [ lower_impl ] . At the time of
21
+ ** Note: We've removed the Chalk unit tests in [ rust-lang/rust #69247 ] .
22
+ They will come back once we're ready to integrate next Chalk into rustc.**
23
+
24
+ A good example test is here. At the time of
27
25
this writing, it looked like this:
28
26
29
27
``` rust,ignore
@@ -40,14 +38,10 @@ fn main() {
40
38
```
41
39
42
40
The ` #[rustc_dump_program_clauses] ` annotation can be attached to
43
- anything with a def-id. (It requires the ` rustc_attrs ` feature.) The
41
+ anything with a def-id (It requires the ` rustc_attrs ` feature). The
44
42
compiler will then invoke the ` program_clauses_for ` query on that
45
43
item, and emit compiler errors that dump the clauses produced. These
46
- errors just exist for unit-testing, as we can then leverage the
47
- standard [ ui test] mechanisms to check them. In this case, there is a
48
- ` //~ ERROR program clause dump ` annotation which is always the same for
49
- ` #[rustc_dump_program_clauses] ` , but [ the stderr file] contains
50
- the full details:
44
+ errors just exist for unit-testing. The stderr will be:
51
45
52
46
``` text
53
47
error: program clause dump
@@ -59,7 +53,4 @@ LL | #[rustc_dump_program_clauses]
59
53
= note: forall<T> { Implemented(T: Foo) :- ProjectionEq(<T as std::iter::Iterator>::Item == i32), TypeOutlives(T: 'static), Implemented(T: std::iter::Iterator), Implemented(T: std::marker::Sized). }
60
54
```
61
55
62
- [ chalkify ] : https://github.com/rust-lang/rust/tree/master/src/test/ui/chalkify
63
- [ lower_impl ] : https://github.com/rust-lang/rust/tree/master/src/test/ui/chalkify/lower_impl.rs
64
- [ the stderr file ] : https://github.com/rust-lang/rust/tree/master/src/test/ui/chalkify/lower_impl.stderr
65
- [ ui test ] : ../tests/adding.html#guide-to-the-ui-tests
56
+ [ rust-lang/rust#69247 ] : https://github.com/rust-lang/rust/pull/69247
0 commit comments