From ad8dfa5a1489b6f77dcbbd3bc84003f7d89b95be Mon Sep 17 00:00:00 2001 From: Jack Huey <31162821+jackh726@users.noreply.github.com> Date: Thu, 1 Dec 2022 10:09:19 -0500 Subject: [PATCH] Add test for example found from removing fresh vars in rustc --- tests/test/misc.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/test/misc.rs b/tests/test/misc.rs index e96e5ef1191..cb65829a601 100644 --- a/tests/test/misc.rs +++ b/tests/test/misc.rs @@ -847,3 +847,34 @@ fn recursive_hang() { } } } + +#[test] +fn coinductive_wrapper() { + test! { + program { + #[coinductive] + trait Foo {} + struct Wrapper {} + + impl Foo for Wrapper> + where + Wrapper: Foo + {} + } + + goal { + exists { + Wrapper: Foo + } + } yields[SolverChoice::slg_default()] { + // FIXME: wrong?? + expect![["Unique; for { substitution [?0 := Wrapper<^0.0>] }"]] + } + } + /* + FIXME: overflows + yields[SolverChoice::recursive_default()] { + expect![[r#"Ambiguous; no inference guidance"#]] + } + */ +}