Skip to content

Commit 808257c

Browse files
committed
Auto merge of #787 - lcnr:update-inductive-canonical-cycle-test, r=jackh726
update `inductive_canonical_cycle` test my concern was already known 😅 https://github.com/rust-lang/chalk/blob/1c2c0caf9e4c46a38bc0f0d4d02fbff3b9c7fb82/book/src/recursive/inductive_cycles.md?plain=1#L48-L66 r? `@jackh726`
2 parents 1c2c0ca + 0ffedf2 commit 808257c

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

tests/test/cycle.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,30 +267,38 @@ fn inductive_canonical_cycle() {
267267
program {
268268
trait Trait<T, U> {}
269269

270+
trait IsNotU32 {}
271+
impl IsNotU32 for i32 {}
272+
impl IsNotU32 for i16 {}
273+
270274
impl<T, U> Trait<T, U> for ()
271275
where
272276
(): Trait<U, T>,
273-
T: OtherTrait,
277+
T: IsNotU32,
274278
{}
279+
impl<T> Trait<u32, T> for () {}
280+
}
275281

276-
trait OtherTrait {}
277-
impl OtherTrait for u32 {}
282+
goal {
283+
(): Trait<i32, u32>
284+
} yields {
285+
expect![["Unique"]]
278286
}
279287

280288
goal {
281-
(): Trait<u32, u32>
289+
(): Trait<u32, i32>
282290
} yields {
283-
// FIXME: Should be unique
284-
expect![["No possible solution"]]
291+
expect![["Unique"]]
285292
}
286293

287294
goal {
288295
exists<T, U> {
289296
(): Trait<T, U>
290297
}
291-
} yields {
292-
// FIXME: Should be unique
293-
expect![["No possible solution"]]
298+
} yields[SolverChoice::slg(10, None)] {
299+
expect![["Ambiguous; no inference guidance"]]
300+
} yields[SolverChoice::recursive_default()] {
301+
expect![["Ambiguous; no inference guidance"]]
294302
}
295303
}
296304
}

0 commit comments

Comments
 (0)