@@ -1944,30 +1944,42 @@ fn unselected_projection() {
1944
1944
}
1945
1945
1946
1946
#[ test]
1947
- #[ should_panic] // FIXME
1948
1947
fn overflow_universe ( ) {
1949
1948
test ! {
1950
1949
program {
1951
1950
struct Foo { }
1952
1951
1953
1952
trait Bar { }
1954
1953
1954
+ // When asked to solve X: Bar, we will produce a
1955
+ // requirement to solve !1: Bar. And then when asked to
1956
+ // solve that, we'll produce a requirement to solve !2:
1957
+ // Bar. And so forth.
1955
1958
forall<X > { X : Bar if forall<Y > { Y : Bar } }
1956
1959
}
1957
1960
1958
1961
goal {
1959
1962
Foo : Bar
1960
1963
} yields[ SolverChoice :: recursive( ) ] {
1961
- // Currently the recursive solver overflows and panics on
1962
- // this example. Once the universe canonicalization work
1963
- // is completed, however, it should not.
1964
- ""
1964
+ // The internal universe canonicalization in the recursive
1965
+ // solver means that when we are asked to solve (e.g.)
1966
+ // `!2: Bar`, we rewrite that to `!1: Bar`, identifying a
1967
+ // cycle.
1968
+ "No possible solution"
1965
1969
} yields[ SolverChoice :: slg( ) ] {
1966
- // The SLG solver currently runs forever; in this setup,
1967
- // it intentionally never gets a *chance* to run. With
1968
- // full universe canonicalization, though, it should not
1969
- // run forever.
1970
- ""
1970
+ // The SLG solver here *currently* works a bit by
1971
+ // accident, as it does not yet do universe
1972
+ // canonicalization internally. However, we wind up with a table
1973
+ // for the goal
1974
+ //
1975
+ // forall<Y> { Y: Bar }
1976
+ //
1977
+ // and that table never produces any answers. But if we
1978
+ // could induce a cycle !1: Bar to !2: Bar to !3: Bar etc,
1979
+ // the SLG solver would loop forever. Ungreat.
1980
+ "No possible solution"
1971
1981
}
1972
1982
}
1983
+
1984
+ panic ! ( )
1973
1985
}
0 commit comments