Auto merge of #91900 - pitaj:fix-91714, r=jyn514

rustdoc: make `--passes` and `--no-defaults` have no effect

Fixes #91714

One potential issue is that currently there is no stable way to achieve `--document-hidden-items`. This affects test `issue-15347`.

I also had to modify the tests `issue-42875` and `no-compiler-export`. Regardless of combinations of `--document-hidden-items` and `--document-private-items`, I was unable to get these to pass without the modifications. I left behind a comment noting the change.
This commit is contained in:
bors 2021-12-20 04:21:12 +00:00
commit 940a97a910
13 changed files with 101 additions and 159 deletions

View file

@ -1,16 +1,15 @@
// check-pass
// compile-flags: --passes unknown-pass
// error-pattern: ignoring unknown pass `unknown-pass`
// error-pattern: the `passes` flag no longer functions
#![doc(no_default_passes)]
//~^ WARNING attribute is deprecated
//~| NOTE see issue #44136
//~| HELP use `#![doc(document_private_items)]`
//~| HELP no longer functions; you may want to use `#![doc(document_private_items)]`
#![doc(passes = "collapse-docs unindent-comments")]
//~^ WARNING attribute is deprecated
//~| NOTE see issue #44136
//~| WARNING ignoring unknown pass
//~| NOTE `collapse-docs` pass was removed
//~| HELP no longer functions; you may want to use `#![doc(document_private_items)]`
#![doc(plugins = "xxx")]
//~^ WARNING attribute is deprecated
//~| NOTE see issue #44136

View file

@ -1,8 +1,7 @@
warning: the `passes` flag is deprecated
warning: the `passes` flag no longer functions
|
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information
warning: ignoring unknown pass `unknown-pass`
= help: you may want to use --document-private-items
warning: the `#![doc(no_default_passes)]` attribute is deprecated
--> $DIR/deprecated-attrs.rs:5:8
@ -11,7 +10,7 @@ LL | #![doc(no_default_passes)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information
= help: you may want to use `#![doc(document_private_items)]`
= help: `#![doc(no_default_passes)]` no longer functions; you may want to use `#![doc(document_private_items)]`
warning: the `#![doc(passes = "...")]` attribute is deprecated
--> $DIR/deprecated-attrs.rs:9:8
@ -20,17 +19,10 @@ LL | #![doc(passes = "collapse-docs unindent-comments")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information
warning: ignoring unknown pass `collapse-docs`
--> $DIR/deprecated-attrs.rs:9:17
|
LL | #![doc(passes = "collapse-docs unindent-comments")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the `collapse-docs` pass was removed in #80261 <https://github.com/rust-lang/rust/pull/80261>
= help: `#![doc(passes = "...")]` no longer functions; you may want to use `#![doc(document_private_items)]`
warning: the `#![doc(plugins = "...")]` attribute is deprecated
--> $DIR/deprecated-attrs.rs:14:8
--> $DIR/deprecated-attrs.rs:13:8
|
LL | #![doc(plugins = "xxx")]
| ^^^^^^^^^^^^^^^
@ -38,5 +30,5 @@ LL | #![doc(plugins = "xxx")]
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information
= warning: `#![doc(plugins = "...")]` no longer functions; see CVE-2018-1000622 <https://nvd.nist.gov/vuln/detail/CVE-2018-1000622>
warning: 5 warnings emitted
warning: 3 warnings emitted

View file

@ -1,3 +1,3 @@
// check-pass
// compile-flags: --passes list
// error-pattern: the `passes` flag is deprecated
// error-pattern: the `passes` flag no longer functions

View file

@ -1,4 +1,5 @@
warning: the `passes` flag is deprecated
warning: the `passes` flag no longer functions
|
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information
= help: you may want to use --document-private-items

View file

@ -1,4 +1,4 @@
// compile-flags: --no-defaults
// compile-flags: --document-private-items
#![crate_name = "foo"]

View file

@ -1,4 +1,4 @@
// compile-flags: --no-defaults
// compile-flags: --document-private-items
#![crate_name = "foo"]

View file

@ -1,4 +1,4 @@
// compile-flags: --no-defaults --passes collapse-docs --passes unindent-comments
// compile-flags: -Z unstable-options --document-hidden-items
// @has issue_15347/fn.foo.html
#[doc(hidden)]

View file

@ -1,13 +0,0 @@
// compile-flags: --no-defaults
#![crate_name = "foo"]
// @has foo/a/index.html '//code' 'use *;'
mod a {
use *;
}
// @has foo/b/index.html '//code' 'pub use *;'
pub mod b {
pub use *;
}

View file

@ -1,7 +1,7 @@
// compile-flags: --no-defaults
// compile-flags: -Z unstable-options --document-hidden-items --document-private-items
#![crate_name = "foo"]
// @has 'foo/index.html' '//code' 'extern crate std;'
// @!has 'foo/index.html' '//code' 'use std::prelude::v1::*;'
// @!has 'foo/index.html' '//code' 'extern crate std;'
// @!has 'foo/index.html' '//code' 'use std::prelude'
pub struct Foo;