Skip to content

Commit 1c2c0ca

Browse files
committed
Auto merge of #786 - jackh726:inductive_canonical_cycle, r=compiler-errors
Add test for inductive canonical cycle See https://github.com/rust-lang/rust/blob/885dcb975ba10511ed2296f51b0db3c17ad7399b/src/test/ui/traits/solver-cycles/inductive-canonical-cycle.rs
2 parents 1054782 + ea3838b commit 1c2c0ca

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ chalk-parse/src/parser.rs
1212

1313
## IDE files
1414
/.idea/
15+
/.vscode/
1516

1617
## Files used in changelog generation
1718
package.json

tests/test/cycle.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,37 @@ fn cycle_with_ambiguity() {
260260
}
261261
}
262262
}
263+
264+
#[test]
265+
fn inductive_canonical_cycle() {
266+
test! {
267+
program {
268+
trait Trait<T, U> {}
269+
270+
impl<T, U> Trait<T, U> for ()
271+
where
272+
(): Trait<U, T>,
273+
T: OtherTrait,
274+
{}
275+
276+
trait OtherTrait {}
277+
impl OtherTrait for u32 {}
278+
}
279+
280+
goal {
281+
(): Trait<u32, u32>
282+
} yields {
283+
// FIXME: Should be unique
284+
expect![["No possible solution"]]
285+
}
286+
287+
goal {
288+
exists<T, U> {
289+
(): Trait<T, U>
290+
}
291+
} yields {
292+
// FIXME: Should be unique
293+
expect![["No possible solution"]]
294+
}
295+
}
296+
}

0 commit comments

Comments
 (0)