Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc doesn't support reading from STDIN via the fake path - (dash) #123671

Closed
fmease opened this issue Apr 9, 2024 · 0 comments · Fixed by #124611
Closed

rustdoc doesn't support reading from STDIN via the fake path - (dash) #123671

fmease opened this issue Apr 9, 2024 · 0 comments · Fixed by #124611
Labels
A-cli Area: Command line interface to the compiler. C-feature-request Category: A feature request, i.e: not implemented / a PR. P-low Low priority T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@fmease
Copy link
Member

fmease commented Apr 9, 2024

While rustc supports reading from STDIN if the fake path - (dash) is provided (a CLI convention), rustdoc does not.

This is definitely not something I need, it's merely an inconsistency between rustc and rustdoc I've noticed and that I'm recording here.

rustc Example

printf 'pub struct F;' | rustc - --crate-type=lib

Crate name: rust_out; virtual file path: <anon>.

Reproducer

printf 'pub struct F;' | rustdoc -

Currently fails with:

error: couldn't read -: No such file or directory (os error 2)
@fmease fmease added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. P-low Low priority C-feature-request Category: A feature request, i.e: not implemented / a PR. A-cli Area: Command line interface to the compiler. labels Apr 9, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 9, 2024
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 9, 2024
@bors bors closed this as completed in bb97203 May 18, 2024
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue May 19, 2024
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](rust-lang/rust#124611 (comment)).

Fixes rust-lang/rust#123671
r? `@fmease`
RalfJung pushed a commit to RalfJung/miri that referenced this issue May 19, 2024
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](rust-lang/rust#124611 (comment)).

Fixes rust-lang/rust#123671
r? `@fmease`
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue May 24, 2024
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](rust-lang/rust#124611 (comment)).

Fixes rust-lang/rust#123671
r? `@fmease`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command line interface to the compiler. C-feature-request Category: A feature request, i.e: not implemented / a PR. P-low Low priority T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants