Skip to content

Commit

Permalink
Auto merge of #787 - lcnr:update-inductive-canonical-cycle-test, r=ja…
Browse files Browse the repository at this point in the history
…ckh726

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`
  • Loading branch information
bors committed Jan 9, 2023
2 parents 1c2c0ca + 0ffedf2 commit 808257c
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tests/test/cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,30 +267,38 @@ fn inductive_canonical_cycle() {
program {
trait Trait<T, U> {}

trait IsNotU32 {}
impl IsNotU32 for i32 {}
impl IsNotU32 for i16 {}

impl<T, U> Trait<T, U> for ()
where
(): Trait<U, T>,
T: OtherTrait,
T: IsNotU32,
{}
impl<T> Trait<u32, T> for () {}
}

trait OtherTrait {}
impl OtherTrait for u32 {}
goal {
(): Trait<i32, u32>
} yields {
expect![["Unique"]]
}

goal {
(): Trait<u32, u32>
(): Trait<u32, i32>
} yields {
// FIXME: Should be unique
expect![["No possible solution"]]
expect![["Unique"]]
}

goal {
exists<T, U> {
(): Trait<T, U>
}
} yields {
// FIXME: Should be unique
expect![["No possible solution"]]
} yields[SolverChoice::slg(10, None)] {
expect![["Ambiguous; no inference guidance"]]
} yields[SolverChoice::recursive_default()] {
expect![["Ambiguous; no inference guidance"]]
}
}
}

0 comments on commit 808257c

Please sign in to comment.