Closed
Description
I tried this code: (Playground Link)
#![feature(const_generics)]
const LEN: usize = 1024;
fn hoge<const IN: [u32; LEN]>() {}
I expected to see this happen: Successful compilation.
Instead, this happened:
error[E0391]: cycle detected when computing type of `hoge::IN`
--> src/lib.rs:5:15
|
5 | fn hoge<const IN: [u32; LEN]>() {}
| ^^
|
= note: ...which again requires computing type of `hoge::IN`, completing the cycle
note: cycle used when computing type of `hoge`
--> src/lib.rs:5:1
|
5 | fn hoge<const IN: [u32; LEN]>() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Meta
rustc --version --verbose
:
rustc 1.46.0-nightly (feb3536eb 2020-06-09)
binary: rustc
commit-hash: feb3536eba10c2e4585d066629598f03d5ddc7c6
commit-date: 2020-06-09
host: x86_64-apple-darwin
release: 1.46.0-nightly
LLVM version: 10.0