File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This is a regression test for one of the problems in #128887; it checks that the
2
+ // strategy in #129714 avoids trait solver overflows in this specific case.
3
+
4
+ // skip-filecheck
5
+ //@ compile-flags: -Zinline-mir
6
+
7
+ pub trait Foo {
8
+ type Associated ;
9
+ type Chain : Foo < Associated = Self :: Associated > ;
10
+ }
11
+
12
+ trait FooExt {
13
+ fn do_ext ( ) { }
14
+ }
15
+ impl < T : Foo < Associated = f64 > > FooExt for T { }
16
+
17
+ #[ allow( unconditional_recursion) ]
18
+ fn recurse < T : Foo < Associated = f64 > > ( ) {
19
+ T :: do_ext ( ) ;
20
+ recurse :: < T :: Chain > ( ) ;
21
+ }
22
+
23
+ macro_rules! emit {
24
+ ( $( $m: ident) * ) => { $(
25
+ pub fn $m<T : Foo <Associated = f64 >>( ) {
26
+ recurse:: <T >( ) ;
27
+ }
28
+ ) * }
29
+ }
30
+
31
+ // Increase the chance of triggering the bug
32
+ emit ! ( m00 m01 m02 m03 m04 m05 m06 m07 m08 m09 m10 m11 m12 m13 m14 m15 m16 m17 m18 m19) ;
You can’t perform that action at this time.
0 commit comments