Skip to content

Rust analyzer hangs processing function using oxc. #20199

@vivax3794

Description

@vivax3794

rust analyzer version: rust-analyzer 1.90.0-nightly (a2d45f7 2025-07-07)

Repro

[package]
name = "testing"
version = "0.1.0"
edition = "2024"

[dependencies]
oxc = {version="0.76.0", default-features=false, features=["minifier"]}
fn main() {
    println!("Hello, world!");
}

fn foo() {
    let allocator = oxc::allocator::Allocator::new();
    let parser = oxc::parser::Parser::new(&allocator, "...", oxc::span::SourceType::cjs());

    let mut program = parser.parse().program;
    let minifier = oxc::minifier::Minifier::new(oxc::minifier::MinifierOptions::default());
    minifier.build(&allocator, &mut program);
}

running rust-analyzer analysis-stats . hangs processing foo

Database loaded:     537.81ms, 249minstr, 51mb (metadata 356.72ms, 2152kinstr, 454kb; build 86.95ms, 1121kinstr, 23kb)
  item trees: 1
  dependency lines of code: 1_544_309, item trees: 3_160
  dependency item stats: traits: 1_087, impl: 16_282, mods: 3_448, macro calls: 6_129, macro rules: 1_405
Item Tree Collection: 3.39s, 28ginstr, 499mb
  Total Statistics:
    crates: 1, mods: 1, decls: 2, bodies: 2, adts: 0, consts: 0
  Workspace:
    traits: 0, macro_rules macros: 0, proc_macros: 0
    lines of code: 22, item trees: 1
    usages: traits: 0, impl: 0, mods: 0, macro calls: 0, macro rules: 0
  Dependencies:
    lines of code: 1_544_309, item trees: 3_160
    declarations: traits: 1_087, impl: 16_282, mods: 3_448, macro calls: 6_129, macro rules: 1_405
Item Collection:     3.72s, 22ginstr, 438mb
Body lowering:       1.50s, 9652minstr, 152mb
1/2 50% processing: testing::foo 

the same setup on rust-analyzer 1.90.0-nightly (a84ab0c 2025-07-06) completes the analysis fine in 11 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Broken WindowBugs / technical debt to be addressed immediatelyI-hangIssue: The analysis never terminates, due to infinite loops, deadlock, livelock, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions