From 0e2f2cccd748028a39603e46afc56d7c20bcc7c8 Mon Sep 17 00:00:00 2001 From: Kyle Lin Date: Sat, 1 Jul 2023 01:20:33 +0800 Subject: [PATCH] Add check-pass tests and fix test behavior --- tests/rustdoc-ui/lints/no-redundancy.rs | 4 ++++ tests/rustdoc/description.rs | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tests/rustdoc-ui/lints/no-redundancy.rs diff --git a/tests/rustdoc-ui/lints/no-redundancy.rs b/tests/rustdoc-ui/lints/no-redundancy.rs new file mode 100644 index 00000000000..17582dff6c8 --- /dev/null +++ b/tests/rustdoc-ui/lints/no-redundancy.rs @@ -0,0 +1,4 @@ +// check-pass + +/// [Vec][std::vec::Vec#examples] should not warn, because it's not actually redundant! +pub fn func() {} diff --git a/tests/rustdoc/description.rs b/tests/rustdoc/description.rs index 918ccd63968..aabbb4c4c8f 100644 --- a/tests/rustdoc/description.rs +++ b/tests/rustdoc/description.rs @@ -1,4 +1,5 @@ #![crate_name = "foo"] +#![allow(rustdoc::redundant_explicit_links)] //! # Description test crate //! //! This is the contents of the test crate docstring. @@ -26,5 +27,5 @@ pub fn foo_fn() {} // @has 'foo/fn.bar_fn.html' '//meta[@name="description"]/@content' \ // 'Description with intra-doc link to foo_fn and [nonexistent_item] and foo_fn.' #[allow(rustdoc::broken_intra_doc_links)] -/// Description with intra-doc link to [foo_fn] and [nonexistent_item] and [foo_fn]. +/// Description with intra-doc link to [foo_fn] and [nonexistent_item] and [foo_fn](self::foo_fn). pub fn bar_fn() {}