File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
chalk-solve/src/clauses/builtin_traits Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ pub fn add_sized_program_clauses<I: Interner>(
77
77
}
78
78
_ => return ,
79
79
} ,
80
+ TyData :: Function ( _) => builder. push_fact ( trait_ref. clone ( ) ) ,
80
81
// TODO(areredify)
81
82
// when #368 lands, extend this to handle everything accordingly
82
83
_ => return ,
Original file line number Diff line number Diff line change
1
+ use super :: * ;
2
+
3
+ #[ test]
4
+ fn functions_are_sized ( ) {
5
+ test ! {
6
+ program {
7
+ #[ lang( sized) ]
8
+ trait Sized { }
9
+
10
+ trait Copy { }
11
+ }
12
+
13
+ goal {
14
+ fn ( ( ) ) : Sized
15
+ } yields {
16
+ "Unique; substitution [], lifetime constraints []"
17
+ }
18
+
19
+ goal {
20
+ fn ( dyn Copy ) : Sized
21
+ } yields {
22
+ "Unique; substitution [], lifetime constraints []"
23
+ }
24
+ }
25
+ }
Original file line number Diff line number Diff line change @@ -309,6 +309,7 @@ mod coherence_goals;
309
309
mod coinduction;
310
310
mod cycle;
311
311
mod existential_types;
312
+ mod functions;
312
313
mod implied_bounds;
313
314
mod impls;
314
315
mod misc;
You can’t perform that action at this time.
0 commit comments