File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11// build-fail
22// normalize-stderr-test: ".nll/" -> "/"
3+ #![ feature( test) ]
34
45fn main ( ) {
5- rec ( Empty ) ;
6+ rec ( Empty , std :: hint :: black_box ( false ) ) ;
67}
78
89struct Empty ;
@@ -18,14 +19,14 @@ fn identity<T>(x: T) -> T {
1819 x
1920}
2021
21- fn rec < T > ( mut it : T )
22+ fn rec < T > ( mut it : T , b : bool )
2223where
2324 T : Iterator ,
2425{
25- if ( ) == ( ) {
26+ if b {
2627 T :: count ( it) ;
2728 } else {
28- rec ( identity ( & mut it) )
29+ rec ( identity ( & mut it) , b )
2930 //~^ ERROR reached the recursion limit while instantiating
3031 }
3132}
Original file line number Diff line number Diff line change 11error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>`
2- --> $DIR/issue-67552.rs:28 :9
2+ --> $DIR/issue-67552.rs:29 :9
33 |
4- LL | rec(identity(&mut it))
5- | ^^^^^^^^^^^^^^^^^^^^^^
4+ LL | rec(identity(&mut it), b )
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
77note: `rec` defined here
8- --> $DIR/issue-67552.rs:21 :1
8+ --> $DIR/issue-67552.rs:22 :1
99 |
10- LL | / fn rec<T>(mut it: T)
10+ LL | / fn rec<T>(mut it: T, b: bool )
1111LL | | where
1212LL | | T: Iterator,
1313 | |________________^
You can’t perform that action at this time.
0 commit comments