Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cycle detected when const-evaluating #67245

Closed
c410-f3r opened this issue Dec 12, 2019 · 1 comment
Closed

Cycle detected when const-evaluating #67245

c410-f3r opened this issue Dec 12, 2019 · 1 comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@c410-f3r
Copy link
Contributor

c410-f3r commented Dec 12, 2019

Only happens with const_generics.

Couldn't find anything related. Feel free to close this issue if it is duplicated.

#![feature(const_generics)]

fn foo<F>(bar: &mut [u8; 8], mut cb: F)
where
    F: FnMut(&mut [u8; 8]),
{
    cb(bar);
}
error[E0391]: cycle detected when const-evaluating + checking `foo::{{constant}}#0`
 --> src/lib.rs:5:24
  |
5 |     F: FnMut(&mut [u8; 8]),
  |                        ^
  |
note: ...which requires const-evaluating + checking `foo::{{constant}}#0`...
 --> src/lib.rs:5:24
  |
5 |     F: FnMut(&mut [u8; 8]),
  |                        ^
note: ...which requires const-evaluating `foo::{{constant}}#0`...
 --> src/lib.rs:5:24
  |
5 |     F: FnMut(&mut [u8; 8]),
  |                        ^
note: ...which requires processing `foo::{{constant}}#0`...
 --> src/lib.rs:5:24
  |
5 |     F: FnMut(&mut [u8; 8]),
  |                        ^
note: ...which requires processing `foo::{{constant}}#0`...
 --> src/lib.rs:5:24
  |
5 |     F: FnMut(&mut [u8; 8]),
  |                        ^
  = note: ...which again requires const-evaluating + checking `foo::{{constant}}#0`, completing the cycle
note: cycle used when processing `foo`
 --> src/lib.rs:3:1
  |
3 | / fn foo<F>(bar: &mut [u8; 8], mut cb: F)
4 | | where
5 | |     F: FnMut(&mut [u8; 8]),
6 | | {
7 | |     cb(bar);
8 | | }
  | |_^
@JohnTitor JohnTitor added A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 12, 2019
@jonas-schievink
Copy link
Contributor

Duplicate of #67185 (comment)

@jonas-schievink jonas-schievink marked this as a duplicate of #67185 Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants