Toolchain
Configuration
rustToolchain()
rustToolchain(version, opts = {})
Declare a Rust toolchain version and optionally set it as the default. without a matching lockfile entry (warns instead of failing). gccToolchain()) registering a "rust-link-driver" product. Falls back to defaultGccToolchain() if omitted. registering a "rust-linker" product. No extra backend flag is added if omitted. kacheToolchain(), see //rules/rust/kache) registering a "rust-build-cache" product. Wraps rustc with kache and points it at a persistent on-disk object cache; no build caching beyond cargo's own (mtime-defeated, sandbox-fresh) incremental state is added if omitted.
| Parameter | Type | Description |
|---|---|---|
| version | string | Exact Rust version, e.g. "1.79.0" (channels rejected). |
| [opts] | object | |
| [opts.default=false] | boolean | Set as the default toolchain. |
| [opts.unverified=false] | boolean | Allow downloading rustup-init |
| [opts.linkDriver] | object | C link driver toolchain handle (e.g. |
| [opts.linker] | object | Linker toolchain handle (e.g. moldToolchain()) |
| [opts.kache] | object | kache toolchain handle (e.g. |
Returns: object Target handle for this Rust toolchain.