diff options
| author | bors <bors@rust-lang.org> | 2022-01-06 15:30:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-06 15:30:46 +0000 |
| commit | cfa4ac66c194046f631ce076c75516ecfdeb77ee (patch) | |
| tree | 10ace45fd5a86349c627f743747c097c5cdb7256 /src/test/rustdoc-ui | |
| parent | a77cc64af491a31db224109a76b9b81cd26cd07c (diff) | |
| parent | 26a90e4cd780175dd2d9dbf061eccd53eb9a2489 (diff) | |
| download | rust-cfa4ac66c194046f631ce076c75516ecfdeb77ee.tar.gz rust-cfa4ac66c194046f631ce076c75516ecfdeb77ee.zip | |
Auto merge of #92609 - matthiaskrgr:rollup-ldp47ot, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #92058 (Make Run button visible on hover) - #92288 (Fix a pair of mistyped test cases in `std::net::ip`) - #92349 (Fix rustdoc::private_doc_tests lint for public re-exported items) - #92360 (Some cleanups around check_argument_types) - #92389 (Regression test for borrowck ICE #92015) - #92404 (Fix font size for [src] links in headers) - #92443 (Rustdoc: resolve associated traits for non-generic primitive types) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-ui')
5 files changed, 47 insertions, 9 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs b/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs index 75159979e88..587cbad6848 100644 --- a/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs +++ b/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs @@ -28,7 +28,6 @@ //! [unit::eq] //~ ERROR unresolved //! [tuple::eq] //~ ERROR unresolved //! [fn::eq] //~ ERROR unresolved -//! [never::eq] //~ ERROR unresolved // FIXME(#78800): This breaks because it's a blanket impl // (I think? Might break for other reasons too.) diff --git a/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr b/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr index 610c8305605..4828a304463 100644 --- a/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr +++ b/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr @@ -53,17 +53,11 @@ error: unresolved link to `fn::eq` LL | //! [fn::eq] | ^^^^^^ the builtin type `fn` has no associated item named `eq` -error: unresolved link to `never::eq` - --> $DIR/non-path-primitives.rs:31:6 - | -LL | //! [never::eq] - | ^^^^^^^^^ the builtin type `never` has no associated item named `eq` - error: unresolved link to `reference::deref` - --> $DIR/non-path-primitives.rs:35:6 + --> $DIR/non-path-primitives.rs:34:6 | LL | //! [reference::deref] | ^^^^^^^^^^^^^^^^ the builtin type `reference` has no associated item named `deref` -error: aborting due to 9 previous errors +error: aborting due to 8 previous errors diff --git a/src/test/rustdoc-ui/private-public-item-doc-test.rs b/src/test/rustdoc-ui/private-public-item-doc-test.rs new file mode 100644 index 00000000000..7cc62b38cc2 --- /dev/null +++ b/src/test/rustdoc-ui/private-public-item-doc-test.rs @@ -0,0 +1,11 @@ +#![deny(rustdoc::private_doc_tests)] + +mod foo { + /// private doc test + /// + /// ``` + /// assert!(false); + /// ``` + //~^^^^^ ERROR documentation test in private item + pub fn bar() {} +} diff --git a/src/test/rustdoc-ui/private-public-item-doc-test.stderr b/src/test/rustdoc-ui/private-public-item-doc-test.stderr new file mode 100644 index 00000000000..f50dbd1844e --- /dev/null +++ b/src/test/rustdoc-ui/private-public-item-doc-test.stderr @@ -0,0 +1,18 @@ +error: documentation test in private item + --> $DIR/private-public-item-doc-test.rs:4:5 + | +LL | / /// private doc test +LL | | /// +LL | | /// ``` +LL | | /// assert!(false); +LL | | /// ``` + | |___________^ + | +note: the lint level is defined here + --> $DIR/private-public-item-doc-test.rs:1:9 + | +LL | #![deny(rustdoc::private_doc_tests)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/rustdoc-ui/public-reexported-item-doc-test.rs b/src/test/rustdoc-ui/public-reexported-item-doc-test.rs new file mode 100644 index 00000000000..b86a53305a1 --- /dev/null +++ b/src/test/rustdoc-ui/public-reexported-item-doc-test.rs @@ -0,0 +1,16 @@ +// check-pass + +#![deny(rustdoc::private_doc_tests)] + +pub fn foo() {} + +mod private { + /// re-exported doc test + /// + /// ``` + /// assert!(true); + /// ``` + pub fn bar() {} +} + +pub use private::bar; |
