Open
Description
Code
const fn foo() {
const { foo() };
}
Current output
Compiling playground v0.0.1 (/playground)
error[E0391]: cycle detected when elaborating drops for `foo`
--> src/lib.rs:2:5
|
2 | const { foo() };
| ^^^^^^^^^^^^^^^
|
note: ...which requires simplifying constant for the type system `foo::{constant#0}`...
--> src/lib.rs:2:5
|
2 | const { foo() };
| ^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `foo::{constant#0}`...
--> src/lib.rs:2:5
|
2 | const { foo() };
| ^^^^^^^^^^^^^^^
note: ...which requires caching mir of `foo` for CTFE...
--> src/lib.rs:1:1
|
1 | const fn foo() {
| ^^^^^^^^^^^^^^
= note: ...which again requires elaborating drops for `foo`, completing the cycle
= note: cycle used when running analysis passes on this crate
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
For more information about this error, try `rustc --explain E0391`.
error: could not compile `playground` (lib) due to 1 previous error
Desired output
Something about constant evaluation failing.
Rationale and extra context
No response
Other cases
No response
Rust Version
Nightly rustc on the playground
1.80.0-nightly (2024-05-28 da159eb331b27df52818)
Anything else?
No response