Skip to content

Commit 1c1ff41

Browse files
committed
Add test for example found from removing fresh vars in rustc
1 parent 75aa6cf commit 1c1ff41

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/test/misc.rs

+31
Original file line numberDiff line numberDiff line change
@@ -847,3 +847,34 @@ fn recursive_hang() {
847847
}
848848
}
849849
}
850+
851+
#[test]
852+
fn coinductive_wrapper() {
853+
test! {
854+
program {
855+
#[coinductive]
856+
trait Foo {}
857+
struct Wrapper<T> {}
858+
859+
impl<T> Foo for Wrapper<Wrapper<T>>
860+
where
861+
Wrapper<T>: Foo
862+
{}
863+
}
864+
865+
goal {
866+
exists<T> {
867+
Wrapper<T>: Foo
868+
}
869+
} yields[SolverChoice::slg_default()] {
870+
// FIXME: wrong??
871+
expect![["Unique; for<?U0> { substitution [?0 := Wrapper<^0.0>] }"]]
872+
}
873+
}
874+
/*
875+
FIXME: overflows stack
876+
yields[SolverChoice::recursive_default()] {
877+
expect![[r#"Ambiguous; no inference guidance"#]]
878+
}
879+
*/
880+
}

0 commit comments

Comments
 (0)