Rust needs a platform-specific linker to produce executables. On Windows the default is Microsoft C++ Built Tools, which is a standalone MSVC toolchain without requiring a full Visual Studio installation.
Nonetheless it may still be regarded a part of Visual Studio, which is a proprietary product. Visual Studio is free under Community licence but almost all companies would have to pay for Pro or Enterprise licences.
The licencing situation of Microsoft C++ Build Tools has long been murky (just search "Microsoft C++ Build Tools licence" and all the results are people asking whether they are allowed to use it without VS licence).
Today Microsoft added a Rust topic to their VSCode docs, which states (emphasis added)
Windows
On Windows, you will need to also install Microsoft C++ Build Tools in order to get the C/C++ linker
link.exe
. Be sure to select the Desktop Development with C++ when running the Visual Studio installer.
Note : You can use the C++ toolset from Visual Studio Build Tools along with Visual Studio Code to compile, build, and verify any codebase as long as you also have a valid Visual Studio license (either Community, Pro, or Enterprise).
The implication here is clear: you must have a VS licence to use link.exe
. For individuals this doesn't matter much as Community licence is free, but for companies it means the Rust default could set them up for a licence violation.
As such, Rust should change the default linker to lld on Windows ASAP. lld has been production quality for many years and this will also simplify the Rust installation experience on Windows as rustup could install rust-lld
by default, no longer requiring users to install Microsoft C++ Build Tools separately (which we can't distribute)