diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-09-28 00:19:31 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-10-09 20:25:44 +0200 |
| commit | bfdfc66f73b3e60ea2024ce090ae036b9f8200cf (patch) | |
| tree | 56c3ad2788d2bcd1fa3231721ef6e56da1bf0190 | |
| parent | 31d275e5877d983fecb39bbaad837f6b7cf120d3 (diff) | |
| download | rust-bfdfc66f73b3e60ea2024ce090ae036b9f8200cf.tar.gz rust-bfdfc66f73b3e60ea2024ce090ae036b9f8200cf.zip | |
Add test to ensure that external items aren't lint-checked
| -rw-r--r-- | src/librustdoc/clean/types.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/intra-doc-broken-reexport.rs | 8 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/pub-export-lint.stderr | 4 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 8b14b3e5de2..6f35ab4b386 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1655,10 +1655,10 @@ pub struct Impl { #[derive(Clone, Debug)] pub enum Import { // use source as str; - // The bool indicates wether it imports a macro or not. + // The bool indicates whether it imports a macro or not. Simple(String, ImportSource, bool), // use source::*; - // The bool indicates wether this is from an import. + // The bool indicates whether this is from an import. Glob(ImportSource, bool), } diff --git a/src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs b/src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs new file mode 100644 index 00000000000..31a8310d472 --- /dev/null +++ b/src/test/rustdoc-ui/auxiliary/intra-doc-broken.rs @@ -0,0 +1,4 @@ +#![crate_name = "intra_doc_broken"] + +/// [not_found] +pub fn foo() {} diff --git a/src/test/rustdoc-ui/intra-doc-broken-reexport.rs b/src/test/rustdoc-ui/intra-doc-broken-reexport.rs new file mode 100644 index 00000000000..ef261359ebd --- /dev/null +++ b/src/test/rustdoc-ui/intra-doc-broken-reexport.rs @@ -0,0 +1,8 @@ +// aux-build:intra-doc-broken.rs +// check-pass + +#![deny(broken_intra_doc_links)] + +extern crate intra_doc_broken; + +pub use intra_doc_broken::foo; diff --git a/src/test/rustdoc-ui/pub-export-lint.stderr b/src/test/rustdoc-ui/pub-export-lint.stderr index 54fe113be65..7fc24d9bea3 100644 --- a/src/test/rustdoc-ui/pub-export-lint.stderr +++ b/src/test/rustdoc-ui/pub-export-lint.stderr @@ -1,8 +1,8 @@ error: unresolved link to `somewhere` --> $DIR/pub-export-lint.rs:3:6 | -LL | /// [somewhere] - | ^^^^^^^^^ the module `pub_export_lint` contains no item named `somewhere` +LL | /// [aloha] + | ^^^^^ no item named `aloha` in scope | note: the lint level is defined here --> $DIR/pub-export-lint.rs:1:9 |
