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 1
1
// build-fail
2
2
// normalize-stderr-test: ".nll/" -> "/"
3
+ #![ feature( test) ]
3
4
4
5
fn main ( ) {
5
- rec ( Empty ) ;
6
+ rec ( Empty , std :: hint :: black_box ( false ) ) ;
6
7
}
7
8
8
9
struct Empty ;
@@ -18,14 +19,14 @@ fn identity<T>(x: T) -> T {
18
19
x
19
20
}
20
21
21
- fn rec < T > ( mut it : T )
22
+ fn rec < T > ( mut it : T , b : bool )
22
23
where
23
24
T : Iterator ,
24
25
{
25
- if ( ) == ( ) {
26
+ if b {
26
27
T :: count ( it) ;
27
28
} else {
28
- rec ( identity ( & mut it) )
29
+ rec ( identity ( & mut it) , b )
29
30
//~^ ERROR reached the recursion limit while instantiating
30
31
}
31
32
}
Original file line number Diff line number Diff line change 1
1
error: 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
3
3
|
4
- LL | rec(identity(&mut it))
5
- | ^^^^^^^^^^^^^^^^^^^^^^
4
+ LL | rec(identity(&mut it), b )
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
|
7
7
note: `rec` defined here
8
- --> $DIR/issue-67552.rs:21 :1
8
+ --> $DIR/issue-67552.rs:22 :1
9
9
|
10
- LL | / fn rec<T>(mut it: T)
10
+ LL | / fn rec<T>(mut it: T, b: bool )
11
11
LL | | where
12
12
LL | | T: Iterator,
13
13
| |________________^
You can’t perform that action at this time.
0 commit comments