On macOS if you install anything with Homebrew that has Rust as a dependency (including any program that has to be built from Rust source), Homebrew will install Rust system-wide and it will take precedence over rustup.
I've ran into this — it looked like if rustup default command didn't work properly. I took me a while to realize that binaries in /usr/local/bin are not from rustup.
Homebrew dislikes using any binaries and update mechanisms they don't control (including rustup), so I think it's up to Rustup to improve this situation.
As a solution I suggest emitting a warning when rustup default command is used if the PATH contains both Rustup rustc and non-Rustup rustc, and non-Rustup rustc is first. That will catch this error, but won't get in the way of using Rustup without the PATH modified for Rustup.
On macOS if you install anything with Homebrew that has Rust as a dependency (including any program that has to be built from Rust source), Homebrew will install Rust system-wide and it will take precedence over rustup.
I've ran into this — it looked like if
rustup defaultcommand didn't work properly. I took me a while to realize that binaries in/usr/local/binare not from rustup.Homebrew dislikes using any binaries and update mechanisms they don't control (including rustup), so I think it's up to Rustup to improve this situation.
As a solution I suggest emitting a warning when
rustup defaultcommand is used if thePATHcontains both Rustup rustc and non-Rustup rustc, and non-Rustup rustc is first. That will catch this error, but won't get in the way of using Rustup without thePATHmodified for Rustup.