From fcbdf08a86216291ff747500b7cfe4d11feb92ad Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Tue, 9 Aug 2022 16:08:42 -0700 Subject: [PATCH 1/2] Add regression test for #93205 This issue was most likely fixed by #93805. --- .../rustdoc/intra-doc/assoc-reexport-super.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/rustdoc/intra-doc/assoc-reexport-super.rs diff --git a/src/test/rustdoc/intra-doc/assoc-reexport-super.rs b/src/test/rustdoc/intra-doc/assoc-reexport-super.rs new file mode 100644 index 0000000000000..c1dda3b4c6cfe --- /dev/null +++ b/src/test/rustdoc/intra-doc/assoc-reexport-super.rs @@ -0,0 +1,20 @@ +// Regression test for #93205 + +#![crate_name = "foo"] + +mod generated { + pub struct MyNewType; + impl MyNewType { + pub const FOO: Self = Self; + } +} + +pub use generated::MyNewType; + +mod prelude { + impl super::MyNewType { + /// An alias for [`Self::FOO`]. + // @has 'foo/struct.MyNewType.html' '//a[@href="struct.MyNewType.html#associatedconstant.FOO"]' + pub const FOO2: Self = Self::FOO; + } +} From 7bfcfd2242e2e5a8ad1599ad916e288b0e025eb8 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Tue, 9 Aug 2022 21:13:31 -0700 Subject: [PATCH 2/2] Fix failing test For some reason, adding some text to match against makes this test pass. Before, when it was *more* general, it was failing! This seems very likely to be a bug in htmldocck, which I'm going to investigate. --- src/test/rustdoc/intra-doc/assoc-reexport-super.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/rustdoc/intra-doc/assoc-reexport-super.rs b/src/test/rustdoc/intra-doc/assoc-reexport-super.rs index c1dda3b4c6cfe..a7bc1c6a29f51 100644 --- a/src/test/rustdoc/intra-doc/assoc-reexport-super.rs +++ b/src/test/rustdoc/intra-doc/assoc-reexport-super.rs @@ -14,7 +14,7 @@ pub use generated::MyNewType; mod prelude { impl super::MyNewType { /// An alias for [`Self::FOO`]. - // @has 'foo/struct.MyNewType.html' '//a[@href="struct.MyNewType.html#associatedconstant.FOO"]' + // @has 'foo/struct.MyNewType.html' '//a[@href="struct.MyNewType.html#associatedconstant.FOO"]' 'Self::FOO' pub const FOO2: Self = Self::FOO; } }