diff options
Diffstat (limited to 'tests/ui/infinite/infinite-recursion-const-fn.rs')
-rw-r--r-- | tests/ui/infinite/infinite-recursion-const-fn.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/infinite/infinite-recursion-const-fn.rs b/tests/ui/infinite/infinite-recursion-const-fn.rs new file mode 100644 index 000000000..420915311 --- /dev/null +++ b/tests/ui/infinite/infinite-recursion-const-fn.rs @@ -0,0 +1,11 @@ +//https://github.com/rust-lang/rust/issues/31364 + +const fn a() -> usize { + b() //~ ERROR evaluation of constant value failed [E0080] +} +const fn b() -> usize { + a() +} +const ARR: [i32; a()] = [5; 6]; + +fn main() {} |