{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/rust-toolchain.json",
  "description": "https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file",
  "properties": {
    "toolchain": {
      "description": "A `toolchain` is a complete installation of the Rust compiler (`rustc`) and related tools (like `cargo`). A toolchain specification includes the release channel or version, and the host platform that the toolchain runs on.\n\n Get more from [`Toolchains`](https://rust-lang.github.io/rustup/concepts/toolchains.html)",
      "type": "object",
      "minProperties": 1,
      "properties": {
        "channel": {
          "description": "`channel` is a named release channel, a major and minor version number such as `1.42`, or a fully specified version number, such as `1.42.0`. Channel names can be optionally appended with an archive date, as in `nightly-2014-12-18`, in which case the toolchain is downloaded from the archive for that date. Get more from [`Toolchain specification`](https://rust-lang.github.io/rustup/concepts/toolchains.html).\n\nOther valid channel like `stable`,`1.63`,`1.63.0`,`nightly-2022-09-20`,`stable-x86_64-pc-windows-msvc`,`1.63.0-riscv64gc-unknown-linux-gnu`,`nightly-2022-09-20-x86_64-unknown-nux-gnu`",
          "type": "string",
          "pattern": "^(?:stable|beta|nightly|\\d+(?:\\.\\d+){1,2})(?:-\\d{4}(?:-\\d{2}){2})?(?:-\\D[^-]*(?:(?:-(?:[^-]+)){1,3}))?$",
          "examples": [
            "stable",
            "1.63",
            "1.63.0",
            "nightly-2022-09-20",
            "stable-x86_64-pc-windows-msvc",
            "1.63.0-riscv64gc-unknown-linux-gnu",
            "nightly-2022-09-20-x86_64-unknown-linux-gnu"
          ],
          "x-taplo": {
            "links": {
              "key": "https://rust-lang.github.io/rustup/concepts/channels.html"
            }
          }
        },
        "components": {
          "description": "Each release of Rust includes several \"components\", some of\nwhich are required (like `rustc`) and some that are optional (like [`clippy`](https://github.com/rust-lang/rust-clippy)) \n\n Learn more from [`Components`](https://rust-lang.github.io/rustup/concepts/components.html)",
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "rustc",
                  "cargo",
                  "rustfmt",
                  "rust-std",
                  "rust-docs",
                  "rls",
                  "clippy",
                  "miri",
                  "rust-src",
                  "rust",
                  "rust-analysis",
                  "llvm-tools",
                  "rustc-docs",
                  "rustc-dev",
                  "rust-analyzer",
                  "reproducible-artifacts",
                  "rust-docs-json"
                ]
              },
              {
                "type": "string",
                "minLength": 1
              }
            ],
            "x-taplo": {
              "docs": {
                "enumValues": [
                  "The Rust compiler and [Rustdoc].\n\n[rustdoc]: https://doc.rust-lang.org/rustdoc/",
                  "[Cargo] is a package manager and build tool.\n\n[cargo]: https://doc.rust-lang.org/cargo/",
                  "[Rustfmt] is a tool for automatically formatting code.\n\n[rustfmt]: https://github.com/rust-lang/rustfmt",
                  "This is the Rust [standard library]. There is a separate\n  `rust-std` component for each target that `rustc` supports, such as\n  `rust-std-x86_64-pc-windows-msvc`. See the [Cross-compilation] chapter for\n  more detail.\n\n[standard library]: https://doc.rust-lang.org/std/\n[cross-compilation]: .https://rust-lang.github.io/rustup/cross-compilation.html",
                  "This is a local copy of the [Rust documentation]. Use the\n  `rustup doc` command to open the documentation in a web browser. Run `rustup\n  doc --help` for more options.\n\n[rust documentation]: https://doc.rust-lang.org/",
                  "[RLS] is a language server that provides support for editors and\n  IDEs.\n\n[RLS]: https://github.com/rust-lang/rls",
                  "[Clippy] is a lint tool that provides extra checks for common\n  mistakes and stylistic choices.\n\n[clippy]: https://github.com/rust-lang/rust-clippy",
                  "[Miri] is an experimental Rust interpreter, which can be used for\n  checking for undefined-behavior.\n\n[miri]: https://github.com/rust-lang/miri/",
                  "This is a local copy of the source code of the Rust standard\n  library. This can be used by some tools, such as [RLS], to provide\n  auto-completion for functions within the standard library; [Miri] which is a\n  Rust interpreter; and Cargo's experimental [build-std] feature, which allows\n  you to rebuild the standard library locally.\n\n[RLS]: https://github.com/rust-lang/rls\n[miri]: https://github.com/rust-lang/miri/\n[build-std]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std",
                  "Metadata about the standard library, used by tools like\n  [RLS].\n\n[RLS]: https://github.com/rust-lang/rls",
                  "This contains a linker and platform libraries for building on\n  the `x86_64-pc-windows-gnu` platform.",
                  "This is an experimental component which contains a\n  collection of [LLVM] tools.\n\n[LLVM]: https://llvm.org/",
                  "This component contains the compiler as a library. Most users\n  will not need this; it is only needed for development *of* tools that link\n  to the compiler, such as making modifications to [Clippy].\n\n[clippy]: https://github.com/rust-lang/rust-clippy"
                ]
              }
            }
          },
          "x-taplo": {
            "links": {
              "key": "https://rust-lang.github.io/rustup/concepts/components.html"
            }
          }
        },
        "targets": {
          "description": "`rustc` is capable of generating code for many platforms. The `target` specifies the platform that the code will be generated for. By default, `cargo` and `rustc` use the host toolchain's platform as the target. To build for a different `target`, usually the target's standard library needs to be installed first via the `rustup target` command. Or you can run `rustc --print target-list` to list [`\"built-in\" targets`](https://doc.rust-lang.org/rustc/targets/built-in.html) \n\n Get more from [`Platform Support`](https://doc.rust-lang.org/rustc/platform-support.html) and [`Targets`](https://doc.rust-lang.org/rustc/targets/index.html)",
          "type": "array",
          "items": {
            "$comment": "From `rustc +nightly --print target-list` or targets listed in https://doc.rust-lang.org/rustc/platform-support.html or https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support.md",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "aarch64-unknown-linux-gnu",
                  "aarch64-apple-darwin",
                  "i686-pc-windows-gnu",
                  "i686-pc-windows-msvc",
                  "i686-unknown-linux-gnu",
                  "x86_64-apple-darwin",
                  "x86_64-pc-windows-gnu",
                  "x86_64-pc-windows-msvc",
                  "x86_64-unknown-linux-gnu",
                  "aarch64-pc-windows-msvc",
                  "aarch64-unknown-linux-musl",
                  "arm-unknown-linux-gnueabi",
                  "arm-unknown-linux-gnueabihf",
                  "armv7-unknown-linux-gnueabihf",
                  "loongarch64-unknown-linux-gnu",
                  "loongarch64-unknown-linux-musl",
                  "powerpc-unknown-linux-gnu",
                  "powerpc64-unknown-linux-gnu",
                  "powerpc64le-unknown-linux-gnu",
                  "riscv64gc-unknown-linux-gnu",
                  "riscv64gc-unknown-linux-musl",
                  "s390x-unknown-linux-gnu",
                  "x86_64-unknown-freebsd",
                  "x86_64-unknown-illumos",
                  "x86_64-unknown-linux-musl",
                  "x86_64-unknown-netbsd",
                  "aarch64-apple-ios",
                  "aarch64-apple-ios-macabi",
                  "aarch64-apple-ios-sim",
                  "aarch64-fuchsia",
                  "aarch64-unknown-fuchsia",
                  "aarch64-linux-android",
                  "aarch64-pc-windows-gnullvm",
                  "aarch64-unknown-linux-ohos",
                  "aarch64-unknown-none-softfloat",
                  "aarch64-unknown-none",
                  "aarch64-unknown-uefi",
                  "arm-linux-androideabi",
                  "arm-unknown-linux-musleabi",
                  "arm-unknown-linux-musleabihf",
                  "arm64ec-pc-windows-msvc",
                  "armebv7r-none-eabi",
                  "armebv7r-none-eabihf",
                  "armv5te-unknown-linux-gnueabi",
                  "armv5te-unknown-linux-musleabi",
                  "armv7-linux-androideabi",
                  "armv7-unknown-linux-gnueabi",
                  "armv7-unknown-linux-musleabi",
                  "armv7-unknown-linux-musleabihf",
                  "armv7-unknown-linux-ohos",
                  "armv7a-none-eabi",
                  "armv7r-none-eabi",
                  "armv7r-none-eabihf",
                  "i586-pc-windows-msvc",
                  "i586-unknown-linux-gnu",
                  "i586-unknown-linux-musl",
                  "i686-linux-android",
                  "i686-pc-windows-gnullvm",
                  "i686-unknown-freebsd",
                  "i686-unknown-linux-musl",
                  "i686-unknown-uefi",
                  "loongarch64-unknown-none",
                  "loongarch64-unknown-none-softfloat",
                  "nvptx64-nvidia-cuda",
                  "riscv32imac-unknown-none-elf",
                  "riscv32i-unknown-none-elf",
                  "riscv32im-unknown-none-elf",
                  "riscv32imc-unknown-none-elf",
                  "riscv32imafc-unknown-none-elf",
                  "riscv64gc-unknown-none-elf",
                  "riscv64imac-unknown-none-elf",
                  "sparc64-unknown-linux-gnu",
                  "sparcv9-sun-solaris",
                  "thumbv6m-none-eabi",
                  "thumbv7em-none-eabi",
                  "thumbv7em-none-eabihf",
                  "thumbv7m-none-eabi",
                  "thumbv7neon-linux-androideabi",
                  "thumbv7neon-unknown-linux-gnueabihf",
                  "thumbv8m.base-none-eabi",
                  "thumbv8m.main-none-eabi",
                  "thumbv8m.main-none-eabihf",
                  "wasm32-unknown-emscripten",
                  "wasm32-unknown-unknown",
                  "wasm32-wasi",
                  "wasm32-wasip1",
                  "wasm32-wasip1-threads",
                  "x86_64-apple-ios",
                  "x86_64-apple-ios-macabi",
                  "x86_64-fortanix-unknown-sgx",
                  "x86_64-fuchsia",
                  "x86_64-unknown-fuchsia",
                  "x86_64-linux-android",
                  "x86_64-pc-solaris",
                  "x86_64-pc-windows-gnullvm",
                  "x86_64-unknown-linux-gnux32",
                  "x86_64-unknown-linux-ohos",
                  "x86_64-unknown-none",
                  "x86_64-unknown-redox",
                  "x86_64-unknown-uefi",
                  "arm64e-apple-ios",
                  "arm64e-apple-darwin",
                  "aarch64-apple-tvos",
                  "aarch64-apple-tvos-sim",
                  "aarch64-apple-watchos",
                  "aarch64-apple-watchos-sim",
                  "aarch64-apple-visionos",
                  "aarch64-apple-visionos-sim",
                  "aarch64-kmc-solid_asp3",
                  "aarch64-nintendo-switch-freestanding",
                  "aarch64-unknown-teeos",
                  "aarch64-unknown-nto-qnx700",
                  "aarch64-unknown-nto-qnx710",
                  "aarch64-unknown-freebsd",
                  "aarch64-unknown-hermit",
                  "aarch64-unknown-illumos",
                  "aarch64-unknown-linux-gnu_ilp32",
                  "aarch64-unknown-netbsd",
                  "aarch64-unknown-openbsd",
                  "aarch64-unknown-redox",
                  "aarch64-unknown-trusty",
                  "aarch64-uwp-windows-msvc",
                  "aarch64-wrs-vxworks",
                  "aarch64_be-unknown-linux-gnu_ilp32",
                  "aarch64_be-unknown-linux-gnu",
                  "aarch64_be-unknown-netbsd",
                  "arm64_32-apple-watchos",
                  "armeb-unknown-linux-gnueabi",
                  "armv4t-none-eabi",
                  "armv4t-unknown-linux-gnueabi",
                  "armv5te-none-eabi",
                  "armv5te-unknown-linux-uclibceabi",
                  "armv6-unknown-freebsd",
                  "armv6-unknown-netbsd-eabihf",
                  "armv6k-nintendo-3ds",
                  "armv7-rtems-eabihf",
                  "armv7-sony-vita-newlibeabihf",
                  "armv7-unknown-linux-uclibceabi",
                  "armv7-unknown-linux-uclibceabihf",
                  "armv7-unknown-freebsd",
                  "armv7-unknown-netbsd-eabihf",
                  "armv7-unknown-trusty",
                  "armv7-wrs-vxworks-eabihf",
                  "armv7a-kmc-solid_asp3-eabi",
                  "armv7a-kmc-solid_asp3-eabihf",
                  "armv7a-none-eabihf",
                  "armv7k-apple-watchos",
                  "armv7s-apple-ios",
                  "armv8r-none-eabihf",
                  "avr-unknown-gnu-atmega328",
                  "bpfeb-unknown-none",
                  "bpfel-unknown-none",
                  "csky-unknown-linux-gnuabiv2",
                  "csky-unknown-linux-gnuabiv2hf",
                  "hexagon-unknown-none-elf",
                  "hexagon-unknown-linux-musl",
                  "i386-apple-ios",
                  "i586-pc-nto-qnx700",
                  "i586-unknown-netbsd",
                  "i686-apple-darwin",
                  "i686-unknown-haiku",
                  "i686-unknown-hurd-gnu",
                  "i686-unknown-netbsd",
                  "i686-unknown-openbsd",
                  "i686-unknown-redox",
                  "i686-uwp-windows-gnu",
                  "i686-uwp-windows-msvc",
                  "i686-win7-windows-msvc",
                  "i686-wrs-vxworks",
                  "m68k-unknown-linux-gnu",
                  "mips-unknown-linux-gnu",
                  "mips-unknown-linux-musl",
                  "mips-unknown-linux-uclibc",
                  "mips64-openwrt-linux-musl",
                  "mips64-unknown-linux-gnuabi64",
                  "mips64-unknown-linux-muslabi64",
                  "mips64el-unknown-linux-gnuabi64",
                  "mips64el-unknown-linux-muslabi64",
                  "mipsel-unknown-linux-gnu",
                  "mipsel-unknown-linux-musl",
                  "mipsel-unknown-netbsd",
                  "mipsel-sony-psp",
                  "mipsel-sony-psx",
                  "mipsel-unknown-linux-uclibc",
                  "mipsel-unknown-none",
                  "mipsisa32r6-unknown-linux-gnu",
                  "mipsisa32r6el-unknown-linux-gnu",
                  "mipsisa64r6-unknown-linux-gnuabi64",
                  "mipsisa64r6el-unknown-linux-gnuabi64",
                  "msp430-none-elf",
                  "powerpc-unknown-linux-gnuspe",
                  "powerpc-unknown-linux-musl",
                  "powerpc-unknown-linux-muslspe",
                  "powerpc-unknown-netbsd",
                  "powerpc-unknown-openbsd",
                  "powerpc-wrs-vxworks-spe",
                  "powerpc-wrs-vxworks",
                  "powerpc64-unknown-freebsd",
                  "powerpc64le-unknown-freebsd",
                  "powerpc-unknown-freebsd",
                  "powerpc64-unknown-linux-musl",
                  "powerpc64-wrs-vxworks",
                  "powerpc64le-unknown-linux-musl",
                  "powerpc64-unknown-openbsd",
                  "powerpc64-ibm-aix",
                  "riscv32gc-unknown-linux-gnu",
                  "riscv32gc-unknown-linux-musl",
                  "riscv32im-risc0-zkvm-elf",
                  "riscv32ima-unknown-none-elf",
                  "riscv32imac-unknown-xous-elf",
                  "riscv32imc-esp-espidf",
                  "riscv32imac-esp-espidf",
                  "riscv32imafc-esp-espidf",
                  "riscv64gc-unknown-hermit",
                  "riscv64gc-unknown-freebsd",
                  "riscv64gc-unknown-fuchsia",
                  "riscv64gc-unknown-netbsd",
                  "riscv64gc-unknown-openbsd",
                  "riscv64-linux-android",
                  "s390x-unknown-linux-musl",
                  "sparc-unknown-linux-gnu",
                  "sparc-unknown-none-elf",
                  "sparc64-unknown-netbsd",
                  "sparc64-unknown-openbsd",
                  "thumbv4t-none-eabi",
                  "thumbv5te-none-eabi",
                  "thumbv7a-pc-windows-msvc",
                  "thumbv7a-uwp-windows-msvc",
                  "thumbv7neon-unknown-linux-musleabihf",
                  "wasm32-wasip2",
                  "wasm64-unknown-unknown",
                  "x86_64-apple-tvos",
                  "x86_64-apple-watchos-sim",
                  "x86_64-pc-nto-qnx710",
                  "x86_64-unikraft-linux-musl",
                  "x86_64-unknown-dragonfly",
                  "x86_64-unknown-haiku",
                  "x86_64-unknown-hurd-gnu",
                  "x86_64-unknown-hermit",
                  "x86_64-unknown-l4re-uclibc",
                  "x86_64-unknown-openbsd",
                  "x86_64-uwp-windows-gnu",
                  "x86_64-uwp-windows-msvc",
                  "x86_64-win7-windows-msvc",
                  "x86_64-wrs-vxworks",
                  "x86_64h-apple-darwin",
                  "x86_64-unknown-linux-none",
                  "xtensa-esp32-none-elf",
                  "xtensa-esp32-espidf",
                  "xtensa-esp32s2-none-elf",
                  "xtensa-esp32s2-espidf",
                  "xtensa-esp32s3-none-elf",
                  "xtensa-esp32s3-espidf",
                  "thumbv6m-nuttx-eabi",
                  "thumbv7m-nuttx-eabi",
                  "thumbv7em-nuttx-eabi",
                  "thumbv7em-nuttx-eabihf",
                  "thumbv8m.base-nuttx-eabi",
                  "thumbv8m.main-nuttx-eabi",
                  "thumbv8m.main-nuttx-eabihf",
                  "riscv32imc-unknown-nuttx-elf",
                  "riscv32imac-unknown-nuttx-elf",
                  "riscv32imafc-unknown-nuttx-elf",
                  "riscv64imac-unknown-nuttx-elf",
                  "riscv64gc-unknown-nuttx-elf"
                ]
              },
              {
                "type": "string",
                "minLength": 1
              }
            ]
          },
          "x-taplo": {
            "links": {
              "key": "https://rust-lang.github.io/rustup/cross-compilation.html"
            }
          }
        },
        "profile": {
          "description": "[`Profiles`](https://rust-lang.github.io/rustup/concepts/profiles.html) are groups of [`components`](https://rust-lang.github.io/rustup/concepts/components.html) you can choose to download while installing a new Rust [`toolchain`](https://rust-lang.github.io/rustup/concepts/toolchains.html).\n\n The `profiles` available at this time are `minimal`, `default`, and `complete`.",
          "type": "string",
          "default": "default",
          "enum": ["minimal", "default", "complete"],
          "x-taplo": {
            "links": {
              "key": "https://rust-lang.github.io/rustup/concepts/profiles.html"
            },
            "docs": {
              "enumValues": [
                "This profile includes as few components as possible to get a\nworking compiler (`rustc`, `rust-std`, and `cargo`). It's recommended to use\nthis component on Windows systems if you don't use local documentation (the\nlarge number of files can cause issues with some Antivirus systems), and in\nCI.",
                "This profile includes all of components in the **minimal**\nprofile, and adds `rust-docs`, `rustfmt`, and `clippy`. This profile will be\nused by `rustup` by default, and it's the one recommended for general use.",
                "This profile includes all the components available through\n`rustup`. This should never be used, as it includes *every* component ever\nincluded in the metadata and thus will almost always fail. If you are\nlooking for a way to install devtools such as `miri` or IDE integration\ntools (`rls`), you should use the `default` profile and\ninstall the needed additional components manually, either by using `rustup\ncomponent add` or by using `-c` when installing the toolchain."
              ]
            }
          }
        },
        "path": {
          "type": "string",
          "description": "Path to a custom local toolchain. Since a `path` directive directly names a local toolchain, other options\nlike `components`, `targets`, and `profile` have no effect. `channel`\nand `path` are mutually exclusive, since a `path` already points to a\nspecific toolchain. A relative `path` is resolved relative to the\nlocation of the `rust-toolchain.toml` file.\n\n Learn more from [`Custom toolchains`](https://rust-lang.github.io/rustup/concepts/toolchains.html#custom-toolchains)"
        }
      },
      "oneOf": [
        {
          "not": {
            "properties": {
              "path": {
                "type": "string"
              }
            },
            "required": ["path"]
          }
        },
        {
          "required": ["path"]
        }
      ],
      "dependencies": {
        "path": {
          "not": {
            "properties": {
              "channel": {
                "type": "string"
              }
            },
            "required": ["channel"]
          }
        },
        "channel": {
          "not": {
            "properties": {
              "path": {
                "type": "string"
              }
            },
            "required": ["path"]
          }
        },
        "profile": {
          "anyOf": [
            {
              "properties": {
                "channel": {
                  "type": "string"
                }
              },
              "required": ["channel"]
            },
            {
              "properties": {
                "components": {
                  "type": "array"
                }
              },
              "required": ["components"]
            },
            {
              "properties": {
                "targets": {
                  "type": "array"
                }
              },
              "required": ["targets"]
            }
          ]
        }
      },
      "x-taplo": {
        "links": {
          "key": "https://rust-lang.github.io/rustup/concepts/toolchains.html"
        },
        "initKeys": ["channel"]
      }
    }
  },
  "required": ["toolchain"],
  "title": "Schema for rust-toolchain.toml",
  "type": "object",
  "x-taplo-info": {
    "authors": ["ian-h-chamberlain (https://github.com/ian-h-chamberlain)"],
    "patterns": ["^(.*(/|\\\\)rust-toolchain([.]toml)?)$"]
  }
}
