Skip to content

Commit 45f1981

Browse files
committed
add test from #125718
1 parent 38e10e5 commit 45f1981

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/ui/consts/recursive-block.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const fn foo<T>() {
2+
const { foo::<&T>() } //~ ERROR: queries overflow the depth limit!
3+
}
4+
5+
fn main () {
6+
const X: () = foo::<i32>();
7+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: queries overflow the depth limit!
2+
--> $DIR/recursive-block.rs:2:11
3+
|
4+
LL | const { foo::<&T>() }
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_block`)
8+
= note: query depth increased by 1 when computing layout of `foo<&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&i32>`
9+
10+
error: aborting due to 1 previous error
11+

0 commit comments

Comments
 (0)