{
  "id": "rustc",
  "name": "rustc",
  "description": "The Rust compiler.",
  "homepage": "https://www.rust-lang.org",
  "executables": [
    "rustc"
  ],
  "commands": {
    "format": 1,
    "label": "Compile a Rust file",
    "description": "Compile one source file. Lints, -C codegen options, -Z, --extern and library paths are left out; most projects should use cargo instead.",
    "quality": "ai-draft",
    "base": "fig:rustc",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": false,
      "short_attached": true,
      "short_bundles": false
    },
    "source": [
      {
        "id": "src",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/rustc.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "input",
        "label": "Source file",
        "type": "path",
        "position": 0,
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "src"
        ]
      },
      {
        "id": "output",
        "label": "Output file",
        "type": "path",
        "option": [
          "-o"
        ],
        "path": {
          "kind": "file",
          "role": "output"
        },
        "sources": [
          "src"
        ]
      },
      {
        "id": "out_dir",
        "label": "Output directory",
        "type": "path",
        "option": [
          "--out-dir"
        ],
        "path": {
          "kind": "directory",
          "role": "output"
        },
        "sources": [
          "src"
        ]
      },
      {
        "id": "crate_type",
        "label": "Crate type",
        "type": "enum",
        "option": [
          "--crate-type"
        ],
        "choices": [
          {
            "value": "bin",
            "label": "bin"
          },
          {
            "value": "lib",
            "label": "lib"
          },
          {
            "value": "rlib",
            "label": "rlib"
          },
          {
            "value": "dylib",
            "label": "dylib"
          },
          {
            "value": "cdylib",
            "label": "cdylib"
          },
          {
            "value": "staticlib",
            "label": "staticlib"
          },
          {
            "value": "proc-macro",
            "label": "proc-macro"
          }
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "crate_name",
        "label": "Crate name",
        "type": "string",
        "option": [
          "--crate-name"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "edition",
        "label": "Edition",
        "type": "enum",
        "option": [
          "--edition"
        ],
        "choices": [
          {
            "value": "2015",
            "label": "2015"
          },
          {
            "value": "2018",
            "label": "2018"
          },
          {
            "value": "2021",
            "label": "2021"
          }
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "emit",
        "label": "Emit",
        "type": "enum",
        "option": [
          "--emit"
        ],
        "choices": [
          {
            "value": "asm",
            "label": "asm"
          },
          {
            "value": "llvm-bc",
            "label": "llvm-bc"
          },
          {
            "value": "llvm-ir",
            "label": "llvm-ir"
          },
          {
            "value": "obj",
            "label": "obj"
          },
          {
            "value": "metadata",
            "label": "metadata"
          },
          {
            "value": "link",
            "label": "link"
          },
          {
            "value": "dep-info",
            "label": "dep-info"
          },
          {
            "value": "mir",
            "label": "mir"
          }
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "optimize",
        "label": "Optimize (-O)",
        "type": "boolean",
        "option": [
          "-O"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "debuginfo",
        "label": "Debug info (-g)",
        "type": "boolean",
        "option": [
          "-g"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "test",
        "label": "Build test harness",
        "type": "boolean",
        "option": [
          "--test"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "target",
        "label": "Target triple",
        "type": "string",
        "option": [
          "--target"
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "print",
        "label": "Print info instead of compiling",
        "type": "enum",
        "option": [
          "--print"
        ],
        "choices": [
          {
            "value": "crate-name",
            "label": "crate-name"
          },
          {
            "value": "file-names",
            "label": "file-names"
          },
          {
            "value": "sysroot",
            "label": "sysroot"
          },
          {
            "value": "target-libdir",
            "label": "target-libdir"
          },
          {
            "value": "cfg",
            "label": "cfg"
          },
          {
            "value": "target-list",
            "label": "target-list"
          },
          {
            "value": "target-cpus",
            "label": "target-cpus"
          },
          {
            "value": "target-features",
            "label": "target-features"
          }
        ],
        "sources": [
          "src"
        ]
      },
      {
        "id": "explain",
        "label": "Explain error code",
        "type": "string",
        "option": [
          "--explain"
        ],
        "sources": [
          "src"
        ]
      }
    ],
    "task": [
      {
        "id": "build",
        "label": "Compile",
        "fields": [
          "input",
          "output",
          "optimize"
        ],
        "required": [
          "input"
        ]
      },
      {
        "id": "lib",
        "label": "Compile a library",
        "fields": [
          "input",
          "crate_type",
          "edition"
        ],
        "required": [
          "input",
          "crate_type"
        ],
        "set": {
          "crate_type": [
            "lib"
          ]
        }
      },
      {
        "id": "explain",
        "label": "Explain an error code",
        "fields": [
          "explain"
        ],
        "required": [
          "explain"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "input",
          "output",
          "crate_type",
          "edition",
          "optimize",
          "debuginfo",
          "test"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "crate_name",
          "print",
          "explain",
          "target",
          "emit",
          "out_dir"
        ]
      }
    ]
  }
}
