Skip to content

Commit 0bfe623

Browse files
committed
Move rust-analyzer to DUP_TOOLS
The rust-analyzer documentation includes the step `cargo install` into `~/.cargo/bin` when building from source. Since this has a chance of accidentally overriding the user's copy, move this to DUP_TOOLS.
1 parent b5639d3 commit 0bfe623

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub static TOOLS: &[&str] = &[
2727
"rust-gdb",
2828
"rust-gdbgui",
2929
"rls",
30-
"rust-analyzer",
3130
"cargo-clippy",
3231
"clippy-driver",
3332
"cargo-miri",
@@ -36,7 +35,7 @@ pub static TOOLS: &[&str] = &[
3635
// Tools which are commonly installed by Cargo as well as rustup. We take a bit
3736
// more care with these to ensure we don't overwrite the user's previous
3837
// installation.
39-
pub static DUP_TOOLS: &[&str] = &["rustfmt", "cargo-fmt"];
38+
pub static DUP_TOOLS: &[&str] = &["rust-analyzer", "rustfmt", "cargo-fmt"];
4039

4140
// If the given name is one of the tools we proxy.
4241
pub fn is_proxyable_tools(tool: &str) -> Result<()> {
@@ -112,8 +111,8 @@ mod tests {
112111
assert!(is_proxyable_tools(tool).is_ok());
113112
}
114113
let message = "unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
115-
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'rust-analyzer', \
116-
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'";
114+
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', \
115+
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rust-analyzer', 'rustfmt', 'cargo-fmt'";
117116
assert_eq!(
118117
is_proxyable_tools("unknown-tool").unwrap_err().to_string(),
119118
message

tests/cli-misc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ fn rustup_failed_path_search() {
413413
broken,
414414
"unknown proxy name: 'fake_proxy'; valid proxy names are \
415415
'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', \
416-
'rls', 'rust-analyzer', 'cargo-clippy', 'clippy-driver', 'cargo-miri', \
417-
'rustfmt', 'cargo-fmt'",
416+
'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', \
417+
'rust-analyzer', 'rustfmt', 'cargo-fmt'",
418418
);
419419

420420
// Hardlink will be automatically cleaned up by test setup code

0 commit comments

Comments
 (0)