-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-const_generics`#![feature(const_generics)]``#![feature(const_generics)]`requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.