rust/compiler
Jacob Pratt 544644476d
Rollup merge of #144498 - Noratrieb:rustc-json-schema, r=jieyouxu,davidtwco
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.

I was motivated to do this because I saw someone write their own version of this schema by hand, so demand for this clearly exists. It's not a lot of effort to implement, so I thought it would make sense.

MCP: https://github.com/rust-lang/compiler-team/issues/905

I think it would also be useful to put this in the sysroot in `etc` so people can link it directly in their editors.

I would have loved to add a test that validates the JSON schema against the spec JSON of every builtin target, but I don't want to do it as the JSON schema validation crates have incredible amounts of dependencies because JSON schema supports a ton of random features. I don't want to add that, even as a dev dependency.
2025-09-13 03:26:01 -04:00
..
2025-08-27 20:25:18 +02:00
2025-09-09 14:49:16 +02:00
2025-09-08 09:23:37 -07:00
2025-09-09 14:49:16 +02:00
2025-09-09 14:49:16 +02:00
2025-09-09 14:49:16 +02:00