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.

ParameterTypeDescription
versionstringExact Rust version, e.g. "1.79.0" (channels rejected).
[opts]object
[opts.default=false]booleanSet as the default toolchain.
[opts.unverified=false]booleanAllow downloading rustup-init
[opts.linkDriver]objectC link driver toolchain handle (e.g.
[opts.linker]objectLinker toolchain handle (e.g. moldToolchain())
[opts.kache]objectkache toolchain handle (e.g.

Returns: object Target handle for this Rust toolchain.