diff options
Diffstat (limited to 'src/test/rustdoc-ui')
6 files changed, 65 insertions, 19 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs b/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs index 9465e8e7ab9..7a5156e81c4 100644 --- a/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs +++ b/src/test/rustdoc-ui/intra-doc/email-address-localhost.rs @@ -1,7 +1,7 @@ // normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL" +// check-pass #![deny(warnings)] //! Email me at <hello@localhost>. -//~^ ERROR unknown disambiguator `hello` //! This should *not* warn: <hello@example.com>. diff --git a/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr b/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr deleted file mode 100644 index 1b07828fc6e..00000000000 --- a/src/test/rustdoc-ui/intra-doc/email-address-localhost.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: unknown disambiguator `hello` - --> $DIR/email-address-localhost.rs:4:18 - | -LL | //! Email me at <hello@localhost>. - | ^^^^^ - | -note: the lint level is defined here - --> $DIR/email-address-localhost.rs:2:9 - | -LL | #![deny(warnings)] - | ^^^^^^^^ - = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]` - = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators - -error: aborting due to previous error - diff --git a/src/test/rustdoc-ui/intra-doc/macro-rules-error.rs b/src/test/rustdoc-ui/intra-doc/macro-rules-error.rs new file mode 100644 index 00000000000..84d63c20aa8 --- /dev/null +++ b/src/test/rustdoc-ui/intra-doc/macro-rules-error.rs @@ -0,0 +1,27 @@ +// `macro_rules` scopes are respected during doc link resolution. + +// compile-flags: --document-private-items + +#![deny(rustdoc::broken_intra_doc_links)] + +mod no_escape { + macro_rules! before_but_limited_to_module { + () => {}; + } +} + +/// [before_but_limited_to_module] FIXME: This error should be reported +// ERROR unresolved link to `before_but_limited_to_module` +/// [after] FIXME: This error should be reported +// ERROR unresolved link to `after` +/// [str] FIXME: This error shouldn not be reported +//~^ ERROR `str` is both a builtin type and a macro +fn check() {} + +macro_rules! after { + () => {}; +} + +macro_rules! str { + () => {}; +} diff --git a/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr b/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr new file mode 100644 index 00000000000..4b984f4f6c0 --- /dev/null +++ b/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr @@ -0,0 +1,22 @@ +error: `str` is both a builtin type and a macro + --> $DIR/macro-rules-error.rs:17:6 + | +LL | /// [str] FIXME: This error shouldn not be reported + | ^^^ ambiguous link + | +note: the lint level is defined here + --> $DIR/macro-rules-error.rs:5:9 + | +LL | #![deny(rustdoc::broken_intra_doc_links)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: to link to the builtin type, prefix with `prim@` + | +LL | /// [prim@str] FIXME: This error shouldn not be reported + | +++++ +help: to link to the macro, add an exclamation mark + | +LL | /// [str!] FIXME: This error shouldn not be reported + | + + +error: aborting due to previous error + diff --git a/src/test/rustdoc-ui/intra-doc/macro-rules.rs b/src/test/rustdoc-ui/intra-doc/macro-rules.rs index a14e4bdf1d7..3aeb370ef6d 100644 --- a/src/test/rustdoc-ui/intra-doc/macro-rules.rs +++ b/src/test/rustdoc-ui/intra-doc/macro-rules.rs @@ -7,3 +7,18 @@ macro_rules! foo { /// [foo!] pub fn baz() {} + +#[macro_use] +mod macros { + macro_rules! escaping { + () => {}; + } +} + +pub mod inner { + /// [foo!] + /// [escaping] + pub fn baz() { + foo!(); + } +} diff --git a/src/test/rustdoc-ui/issue-91713.stdout b/src/test/rustdoc-ui/issue-91713.stdout index d0372d4945f..a19e452b459 100644 --- a/src/test/rustdoc-ui/issue-91713.stdout +++ b/src/test/rustdoc-ui/issue-91713.stdout @@ -1,7 +1,6 @@ Available passes for running rustdoc: check_doc_test_visibility - run various visibility-related lints on doctests strip-hidden - strips all `#[doc(hidden)]` items from the output - unindent-comments - removes excess indentation on comments in order for markdown to like it strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items @@ -14,7 +13,6 @@ check-invalid-html-tags - detects invalid HTML tags in doc comments Default passes for rustdoc: collect-trait-impls - unindent-comments check_doc_test_visibility strip-hidden (when not --document-hidden-items) strip-private (when not --document-private-items) |
