File tree 1 file changed +9
-3
lines changed 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,15 @@ fn ordering() {
228
228
}
229
229
230
230
#[ test]
231
- fn cycles ( ) {
232
- // only solution: infinite type S<S<S<...
231
+ fn cycle_no_solution ( ) {
233
232
test ! {
234
233
program {
235
234
trait Foo { }
236
235
struct S <T > { }
237
236
impl <T > Foo for S <T > where T : Foo { }
238
237
}
239
238
239
+ // only solution: infinite type S<S<S<...
240
240
goal {
241
241
exists<T > {
242
242
T : Foo
@@ -245,8 +245,10 @@ fn cycles() {
245
245
"No possible solution: no applicable candidates"
246
246
}
247
247
}
248
+ }
248
249
249
- // infinite family of solutions: {i32, S<i32>, S<S<i32>>, ... }
250
+ #[ test]
251
+ fn cycle_many_solutions ( ) {
250
252
test ! {
251
253
program {
252
254
trait Foo { }
@@ -256,6 +258,7 @@ fn cycles() {
256
258
impl Foo for i32 { }
257
259
}
258
260
261
+ // infinite family of solutions: {i32, S<i32>, S<S<i32>>, ... }
259
262
goal {
260
263
exists<T > {
261
264
T : Foo
@@ -264,7 +267,10 @@ fn cycles() {
264
267
"Ambiguous; no inference guidance"
265
268
}
266
269
}
270
+ }
267
271
272
+ #[ test]
273
+ fn cycle_unique_solution ( ) {
268
274
test ! {
269
275
program {
270
276
trait Foo { }
You can’t perform that action at this time.
0 commit comments