Skip to content

cycle detected when optimizing MIR #143534

@flippette

Description

@flippette

Code

I tried installing dioxus-cli

cargo install -f dioxus-cli

The crate failed to build with this error

error[E0391]: cycle detected when optimizing MIR for `ExprExt::cast_to_bool`                                                                                                  
   --> /home/flippette/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/swc_ecma_utils-7.0.0/src/lib.rs:742:5                                                             
    |
742 |     fn cast_to_bool(&self, ctx: &ExprCtx) -> (Purity, BoolValue) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: ...which requires optimizing MIR for `ExprExt::cast_to_number`...
   --> /home/flippette/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/swc_ecma_utils-7.0.0/src/lib.rs:970:5
    |
970 |     fn cast_to_number(&self, ctx: &ExprCtx) -> (Purity, Value<f64>) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: ...which again requires optimizing MIR for `ExprExt::cast_to_bool`, completing the cycle
    = 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 `swc_ecma_utils` (lib) due to 1 previous error

Version it worked on

1.90.0-nightly (bdaba05a9 2025-06-27) and before (I've only tested back through 1.89.0-nightly (d4e1159b8 2025-06-21))

Version with regression

1.90.0-nightly (11ad40bb8 2025-06-28) through to 1.90.0-nightly (5adb489a8 2025-07-05)

Backtrace

N/A

@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.I-cycleIssue: A query cycle occurred while none was expectedI-prioritizeIssue: Indicates that prioritization has been requested for this issue.S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions