diff options
| author | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2025-07-26 12:39:31 +0200 |
|---|---|---|
| committer | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2025-09-12 20:53:28 +0200 |
| commit | f157ce994ea45e9faea9eff89c5f8b3d4ea77b6e (patch) | |
| tree | ea0f0bdfa8bb940eeb9f2dff68076bf3d7082d77 /compiler/rustc_driver_impl | |
| parent | a0bb9cc57db551289cba9fefde086e45cb82733f (diff) | |
| download | rust-f157ce994ea45e9faea9eff89c5f8b3d4ea77b6e.tar.gz rust-f157ce994ea45e9faea9eff89c5f8b3d4ea77b6e.zip | |
Add --print target-spec-json-schema
This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema.
Diffstat (limited to 'compiler/rustc_driver_impl')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index d00a4c35834..4f875cf99ec 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -668,6 +668,10 @@ fn print_crate_info( TargetSpecJson => { println_info!("{}", serde_json::to_string_pretty(&sess.target.to_json()).unwrap()); } + TargetSpecJsonSchema => { + let schema = rustc_target::spec::json_schema(); + println_info!("{}", serde_json::to_string_pretty(&schema).unwrap()); + } AllTargetSpecsJson => { let mut targets = BTreeMap::new(); for name in rustc_target::spec::TARGETS { |
