File tree 2 files changed +52
-1
lines changed
2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ fn generator_test() {
32
32
witnesses exists<' a, ' b> [ SendAnyLifetime <' a, ' b, T >; u8 ]
33
33
}
34
34
35
-
36
35
generator not_send_resume_yield<>[ resume = NotSend , yield = NotSend ] {
37
36
upvars [ ]
38
37
witnesses [ ]
@@ -85,5 +84,13 @@ fn generator_test() {
85
84
} yields {
86
85
"Unique; substitution [], lifetime constraints []"
87
86
}
87
+
88
+ goal {
89
+ forall<T > {
90
+ send_any_lifetime<T >: Send
91
+ }
92
+ } yields {
93
+ "No possible solution"
94
+ }
88
95
}
89
96
}
Original file line number Diff line number Diff line change @@ -84,3 +84,47 @@ fn unpin_overwrite() {
84
84
}
85
85
}
86
86
}
87
+
88
+ #[ test]
89
+ fn generator_unpin ( ) {
90
+ test ! {
91
+ program {
92
+ #[ auto] #[ lang( unpin) ] trait Unpin { }
93
+ struct A { }
94
+ impl !Unpin for A { }
95
+
96
+ generator static static_gen<>[ resume = ( ) , yield = ( ) ] {
97
+ upvars [ ]
98
+ witnesses [ ]
99
+ }
100
+
101
+ generator movable_gen<>[ resume = ( ) , yield = ( ) ] {
102
+ upvars [ ]
103
+ witnesses [ ]
104
+ }
105
+
106
+ generator movable_with_pin<>[ resume = ( ) , yield = ( ) ] {
107
+ upvars [ A ]
108
+ witnesses [ ]
109
+ }
110
+ }
111
+
112
+ goal {
113
+ static_gen: Unpin
114
+ } yields {
115
+ "No possible solution"
116
+ }
117
+
118
+ goal {
119
+ movable_gen: Unpin
120
+ } yields {
121
+ "Unique"
122
+ }
123
+
124
+ goal {
125
+ movable_with_pin: Unpin
126
+ } yields {
127
+ "Unique"
128
+ }
129
+ }
130
+ }
You can’t perform that action at this time.
0 commit comments