Rollup merge of #134531 - GuillaumeGomez:extract-doctests, r=notriddle,aDotInTheVoid

[rustdoc] Add `--extract-doctests` command-line flag

Part of https://github.com/rust-lang/rust/issues/134529.

It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](https://github.com/Rust-for-Linux/linux/issues/2)).

For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information:

 * filename
 * line
 * langstr
 * text

cc `@ojeda`
r? `@notriddle`
This commit is contained in:
Matthias Krüger 2025-01-31 12:28:15 +01:00 committed by GitHub
commit 5f01a76fe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

Diff Content Not Available