Skip to content

Fix incorrect rust-buffer-project for remote buffers#582

Merged
psibi merged 1 commit intorust-lang:masterfrom
bilginsenol:master
Jan 1, 2026
Merged

Fix incorrect rust-buffer-project for remote buffers#582
psibi merged 1 commit intorust-lang:masterfrom
bilginsenol:master

Conversation

@bilginsenol
Copy link
Contributor

My attempt to solve the issue I created in #581 by checking if the default-directory is on a remote path in the rust-buffer-project function.

rust-buffer-project function calls `cargo locate-project`, which
returns the local path to the Cargo.toml. This causes `cargo` commands
such as `cargo clippy` executed through the rust-mode to fail (because
it is looking for a local path instead of remote host path) if the
project is on a remote tramp connection. Fix by prepending "root" with
remote prefix if `file-remote-p default-directory` is not nil.
Copy link
Member

@psibi psibi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Since there is an already existing test function named rust-test-compile which exercises this code path, I feel comfortable enough to merge this.

@psibi psibi merged commit ae161dc into rust-lang:master Jan 1, 2026
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants