Skip to content

Commit bbb8201

Browse files
committed
add test from #114192
1 parent 66c9a59 commit bbb8201

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ build-fail
2+
3+
struct Thing<T>(T);
4+
5+
impl<T> Thing<T> {
6+
const X: usize = Thing::<Option<T>>::X;
7+
}
8+
9+
fn main() {
10+
println!("{}", Thing::<i32>::X); //~ ERROR: queries overflow the depth limit!
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: queries overflow the depth limit!
2+
--> $DIR/recursive-const-in-impl.rs:10:14
3+
|
4+
LL | println!("{}", Thing::<i32>::X);
5+
| ^^^^
6+
|
7+
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_const_in_impl`)
8+
= note: query depth increased by 130 when simplifying constant for the type system `main::promoted[1]`
9+
10+
error: aborting due to 1 previous error
11+

0 commit comments

Comments
 (0)