about summary refs log tree commit diff
path: root/src/doc/rustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-18 10:53:47 +0000
committerbors <bors@rust-lang.org>2024-05-18 10:53:47 +0000
commitbb97203e37bbdd4588bd684728002077d0073978 (patch)
tree7854c16653291ce69a8cc0af87ed13a9e43b75a2 /src/doc/rustdoc
parent1c90b9fe6eac122b4d3965913b3615f47751a4d3 (diff)
parent7e1dc742d620123f251c696c8aae864a226d1c89 (diff)
downloadrust-bb97203e37bbdd4588bd684728002077d0073978.tar.gz
rust-bb97203e37bbdd4588bd684728002077d0073978.zip
Auto merge of #124611 - Urgau:rustdoc-stdin, r=GuillaumeGomez
Add `-` (stdin) support in rustdoc

This PR adds support for the special `-` input which threats the input as coming from *stdin* instead of being a filepath.

Doing this also makes `rustdoc` consistent with `rustc` and ~~every~~ other tools. Full [motivation](https://github.com/rust-lang/rust/pull/124611#issuecomment-2094234876).

Fixes https://github.com/rust-lang/rust/issues/123671
r? `@fmease`
Diffstat (limited to 'src/doc/rustdoc')
-rw-r--r--src/doc/rustdoc/src/command-line-arguments.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md
index 69fb7e3313f..3e104bdb470 100644
--- a/src/doc/rustdoc/src/command-line-arguments.md
+++ b/src/doc/rustdoc/src/command-line-arguments.md
@@ -417,6 +417,12 @@ When `rustdoc` receives this flag, it will print an extra "Version (version)" in
 the crate root's docs. You can use this flag to differentiate between different versions of your
 library's documentation.
 
+## `-`: load source code from the standard input
+
+If you specify `-` as the INPUT on the command line, then `rustdoc` will read the
+source code from stdin (standard input stream) until the EOF, instead of the file
+system with an otherwise specified path.
+
 ## `@path`: load command-line flags from a path
 
 If you specify `@path` on the command-line, then it will open `path` and read