From 7c0d576c59e9429157449e617ec5607373afc642 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 27 Sep 2020 21:22:39 +0200 Subject: [PATCH] Add test for reexported items lints --- src/test/rustdoc-ui/pub-export-lint.rs | 8 ++++++++ src/test/rustdoc-ui/pub-export-lint.stderr | 23 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/test/rustdoc-ui/pub-export-lint.rs create mode 100644 src/test/rustdoc-ui/pub-export-lint.stderr diff --git a/src/test/rustdoc-ui/pub-export-lint.rs b/src/test/rustdoc-ui/pub-export-lint.rs new file mode 100644 index 00000000000..31953206fd9 --- /dev/null +++ b/src/test/rustdoc-ui/pub-export-lint.rs @@ -0,0 +1,8 @@ +#![deny(broken_intra_doc_links)] + +/// [somewhere] +//~^ ERROR unresolved link to `somewhere` +pub use std::str::*; +/// [aloha] +//~^ ERROR unresolved link to `aloha` +pub use std::task::RawWakerVTable; diff --git a/src/test/rustdoc-ui/pub-export-lint.stderr b/src/test/rustdoc-ui/pub-export-lint.stderr new file mode 100644 index 00000000000..54fe113be65 --- /dev/null +++ b/src/test/rustdoc-ui/pub-export-lint.stderr @@ -0,0 +1,23 @@ +error: unresolved link to `somewhere` + --> $DIR/pub-export-lint.rs:3:6 + | +LL | /// [somewhere] + | ^^^^^^^^^ the module `pub_export_lint` contains no item named `somewhere` + | +note: the lint level is defined here + --> $DIR/pub-export-lint.rs:1:9 + | +LL | #![deny(broken_intra_doc_links)] + | ^^^^^^^^^^^^^^^^^^^^^^ + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +error: unresolved link to `aloha` + --> $DIR/pub-export-lint.rs:6:6 + | +LL | /// [aloha] + | ^^^^^ the module `pub_export_lint` contains no item named `aloha` + | + = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` + +error: aborting due to 2 previous errors +