-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ build-fail | ||
|
||
struct Thing<T>(T); | ||
|
||
impl<T> Thing<T> { | ||
const X: usize = Thing::<Option<T>>::X; | ||
} | ||
|
||
fn main() { | ||
println!("{}", Thing::<i32>::X); //~ ERROR: queries overflow the depth limit! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: queries overflow the depth limit! | ||
--> $DIR/recursive-const-in-impl.rs:10:14 | ||
| | ||
LL | println!("{}", Thing::<i32>::X); | ||
| ^^^^ | ||
| | ||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_const_in_impl`) | ||
= note: query depth increased by 130 when simplifying constant for the type system `main::promoted[1]` | ||
|
||
error: aborting due to 1 previous error | ||
|