Skip to content

Commit 3d43b90

Browse files
committed
Make instantiation limit test independent of MIR inlining
1 parent aefc721 commit 3d43b90

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/test/ui/issues/issue-67552.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// build-fail
22
// normalize-stderr-test: ".nll/" -> "/"
3+
#![feature(test)]
34

45
fn main() {
5-
rec(Empty);
6+
rec(Empty, std::hint::black_box(false));
67
}
78

89
struct 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)
2223
where
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
}

src/test/ui/issues/issue-67552.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
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
33
|
4-
LL | rec(identity(&mut it))
5-
| ^^^^^^^^^^^^^^^^^^^^^^
4+
LL | rec(identity(&mut it), b)
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: `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)
1111
LL | | where
1212
LL | | T: Iterator,
1313
| |________________^

0 commit comments

Comments
 (0)