What is the recommended way to install & update rust-analyzer on macOS?

⚓ Rust    📅 2025-12-31    👤 surdeus    👁️ 5      

surdeus

As the title says, what is the generally recommended/intended/best way to install rust-analyzer on macOS, especially if I want weekly updates? I was originally installing it via Homebrew, but that required moving ~/.cargo/bin to the end of my PATH to keep the rust-analyzer stub therein from taking priority over Homebrew's binary. When I asked about the stub on /r/rust, I was told that rust-analyzer should be installed through rustup instead. I did that, but now (as of Rust 1.92) I have a different problem: Whenever I open a Rust source file while in a subdirectory of a Rust project, a misplaced target/ directory (containing just rust-analyzer/flycheck0/{stdout,stderr}) gets created in that subdirectory, cluttering things up. I suspect that rust-analyzer fixed this bug in the next weekly release, but rustup only seems to provide rust-analyzer versions corresponding to rustc releases, so I'm currently on track to be stuck with this behavior until January 22.

Is there a way to force rustup to install the latest weekly release of rust-analyzer, even if there hasn't been a rustc release to go with it? If not, why shouldn't I just switch back to installing via Homebrew? Is there a better way to install rust-analyzer?

2 posts - 2 participants

Read full topic

🏷️ Rust_feed