On MacOS, you should replace the default llvm with the one from brew:
brew install llvmWe recommend creating a .cargo folder at the root of this repository with the following
config.toml file:
[env]
AR = "/opt/homebrew/opt/llvm/bin/llvm-ar"
CC = "/opt/homebrew/opt/llvm/bin/clang"Additionally, if you're using rust-analyzer in VSCode, you'll want to add the following to
your .vscode/settings.json file:
{
"rust-analyzer.server.extraEnv": {
"AR": "/opt/homebrew/opt/llvm/bin/llvm-ar",
"CC": "/opt/homebrew/opt/llvm/bin/clang"
},
"rust-analyzer.cargo.target": "wasm32-unknown-unknown"
}System-wide installation of rust might conflict with brew-managed rustup installation, see:
To use brew-managed rustup package, you can use:
brew uninstall rust
brew unlink rust
brew install rustup
export PATH="${PATH}:$(brew --prefix rustup)/bin" # .{bash,zsh}rc