File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,15 @@ fn ordering() {
228228}
229229
230230#[ test]
231- fn cycles ( ) {
232- // only solution: infinite type S<S<S<...
231+ fn cycle_no_solution ( ) {
233232 test ! {
234233 program {
235234 trait Foo { }
236235 struct S <T > { }
237236 impl <T > Foo for S <T > where T : Foo { }
238237 }
239238
239+ // only solution: infinite type S<S<S<...
240240 goal {
241241 exists<T > {
242242 T : Foo
@@ -245,8 +245,10 @@ fn cycles() {
245245 "No possible solution: no applicable candidates"
246246 }
247247 }
248+ }
248249
249- // infinite family of solutions: {i32, S<i32>, S<S<i32>>, ... }
250+ #[ test]
251+ fn cycle_many_solutions ( ) {
250252 test ! {
251253 program {
252254 trait Foo { }
@@ -256,6 +258,7 @@ fn cycles() {
256258 impl Foo for i32 { }
257259 }
258260
261+ // infinite family of solutions: {i32, S<i32>, S<S<i32>>, ... }
259262 goal {
260263 exists<T > {
261264 T : Foo
@@ -264,7 +267,10 @@ fn cycles() {
264267 "Ambiguous; no inference guidance"
265268 }
266269 }
270+ }
267271
272+ #[ test]
273+ fn cycle_unique_solution ( ) {
268274 test ! {
269275 program {
270276 trait Foo { }
You can’t perform that action at this time.
0 commit comments