File tree Expand file tree Collapse file tree 3 files changed +48
-46
lines changed Expand file tree Collapse file tree 3 files changed +48
-46
lines changed Original file line number Diff line number Diff line change 22
33use super :: * ;
44
5- #[ test]
6- fn opaque_bounds ( ) {
7- test ! {
8- program {
9- struct Ty { }
10-
11- trait Clone { }
12- opaque type T : Clone = Ty ;
13- }
14-
15- goal {
16- T : Clone
17- } yields {
18- "Unique; substitution []"
19- }
20- }
21- }
22-
23- #[ test]
24- fn opaque_reveal ( ) {
25- test ! {
26- program {
27- struct Ty { }
28- trait Trait { }
29- impl Trait for Ty { }
30-
31- trait Clone { }
32- opaque type T : Clone = Ty ;
33- }
34-
35- goal {
36- if ( Reveal ) {
37- T : Trait
38- }
39- } yields {
40- "Unique; substitution []"
41- }
42-
43- goal {
44- T : Trait
45- } yields {
46- "No possible solution"
47- }
48- }
49- }
50-
515#[ test]
526fn dyn_Clone_is_Clone ( ) {
537 test ! {
Original file line number Diff line number Diff line change @@ -308,6 +308,7 @@ mod impls;
308308mod misc;
309309mod negation;
310310mod object_safe;
311+ mod opaque_types;
311312mod projection;
312313mod refs;
313314mod scalars;
Original file line number Diff line number Diff line change 1+ use super :: * ;
2+
3+ #[ test]
4+ fn opaque_bounds ( ) {
5+ test ! {
6+ program {
7+ struct Ty { }
8+
9+ trait Clone { }
10+ opaque type T : Clone = Ty ;
11+ }
12+
13+ goal {
14+ T : Clone
15+ } yields {
16+ "Unique; substitution []"
17+ }
18+ }
19+ }
20+
21+ #[ test]
22+ fn opaque_reveal ( ) {
23+ test ! {
24+ program {
25+ struct Ty { }
26+ trait Trait { }
27+ impl Trait for Ty { }
28+
29+ trait Clone { }
30+ opaque type T : Clone = Ty ;
31+ }
32+
33+ goal {
34+ if ( Reveal ) {
35+ T : Trait
36+ }
37+ } yields {
38+ "Unique; substitution []"
39+ }
40+
41+ goal {
42+ T : Trait
43+ } yields {
44+ "No possible solution"
45+ }
46+ }
47+ }
You can’t perform that action at this time.
0 commit comments