Rollup merge of #91310 - hi-rustin:rustin-patch-rustdoc, r=jyn514

Add --out-dir flag for rustdoc

part of https://github.com/rust-lang/rust/issues/91260

Add --out-dir flag for rustdoc and change the `-o` option to point to out-dir.

I'm not quite sure if it should be stable, also I'm not sure if this parameter priority is appropriate? Or should I just refuse to pass both parameters at the same time?

r? `@jyn514`
This commit is contained in:
Matthias Krüger 2021-12-11 08:22:30 +01:00 committed by GitHub
commit d8bb4d69db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 57 additions and 5 deletions

View file

@ -0,0 +1,8 @@
-include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
all:
$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --out-dir $(OUTPUT_DIR)
$(HTMLDOCCK) $(OUTPUT_DIR) src/lib.rs

View file

@ -0,0 +1,2 @@
// @has foobar/fn.ok.html
pub fn ok() {}

View file

@ -0,0 +1,8 @@
-include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
all:
$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --output $(OUTPUT_DIR)
$(HTMLDOCCK) $(OUTPUT_DIR) src/lib.rs

View file

@ -0,0 +1,2 @@
// @has foobar/fn.ok.html
pub fn ok() {}

View file

@ -0,0 +1,8 @@
-include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
all:
$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib -o $(OUTPUT_DIR)
$(HTMLDOCCK) $(OUTPUT_DIR) src/lib.rs

View file

@ -0,0 +1,2 @@
// @has foobar/fn.ok.html
pub fn ok() {}

View file

@ -0,0 +1 @@
// compile-flags: --output ./foo

View file

@ -0,0 +1,2 @@
error: cannot use both 'out-dir' and 'output' at once