Skip to content

Commit

Permalink
Make instantiation limit test independent of MIR inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Jan 16, 2021
1 parent aefc721 commit 3d43b90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/test/ui/issues/issue-67552.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// build-fail
// normalize-stderr-test: ".nll/" -> "/"
#![feature(test)]

fn main() {
rec(Empty);
rec(Empty, std::hint::black_box(false));
}

struct Empty;
Expand All @@ -18,14 +19,14 @@ fn identity<T>(x: T) -> T {
x
}

fn rec<T>(mut it: T)
fn rec<T>(mut it: T, b: bool)
where
T: Iterator,
{
if () == () {
if b {
T::count(it);
} else {
rec(identity(&mut it))
rec(identity(&mut it), b)
//~^ ERROR reached the recursion limit while instantiating
}
}
10 changes: 5 additions & 5 deletions src/test/ui/issues/issue-67552.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>`
--> $DIR/issue-67552.rs:28:9
--> $DIR/issue-67552.rs:29:9
|
LL | rec(identity(&mut it))
| ^^^^^^^^^^^^^^^^^^^^^^
LL | rec(identity(&mut it), b)
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: `rec` defined here
--> $DIR/issue-67552.rs:21:1
--> $DIR/issue-67552.rs:22:1
|
LL | / fn rec<T>(mut it: T)
LL | / fn rec<T>(mut it: T, b: bool)
LL | | where
LL | | T: Iterator,
| |________________^
Expand Down

0 comments on commit 3d43b90

Please sign in to comment.