diff options
| author | binarycat <binarycat@envs.net> | 2025-08-05 15:23:14 -0500 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2025-08-05 15:34:51 -0500 |
| commit | 34b358d52aa6842e512dacbf97c7d3a9e18795e6 (patch) | |
| tree | b6566fb1c46f8a7c572e22caf4fa57e74a8e8d83 /tests/rustdoc | |
| parent | 213d946a384b46989f6fd9c8ae9c547b4e354455 (diff) | |
| download | rust-34b358d52aa6842e512dacbf97c7d3a9e18795e6.tar.gz rust-34b358d52aa6842e512dacbf97c7d3a9e18795e6.zip | |
rustdoc: fix caching of intra-doc links on reexports
Diffstat (limited to 'tests/rustdoc')
| -rw-r--r-- | tests/rustdoc/intra-doc/macro-caching-144965.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/rustdoc/intra-doc/macro-caching-144965.rs b/tests/rustdoc/intra-doc/macro-caching-144965.rs new file mode 100644 index 00000000000..e14b465aeea --- /dev/null +++ b/tests/rustdoc/intra-doc/macro-caching-144965.rs @@ -0,0 +1,35 @@ +// regression test for https://github.com/rust-lang/rust/issues/144965 + +#![crate_name = "foo"] +#![no_std] + +#[doc(hidden)] +pub struct MyStruct; + +macro_rules! my_macro { + () => { + pub fn my_function() {} + + /// Incorrect: [`my_function()`]. + #[doc(inline)] + pub use $crate::MyStruct; + + /// Correct: [`my_function`]. + pub struct AnotherStruct; + }; +} + + +pub mod one { + //@ has 'foo/one/index.html' + //@ has - '//dl[@class="item-table"]/dd[1]/a[@href="fn.my_function.html"]/code' 'my_function' + //@ has - '//dl[@class="item-table"]/dd[2]/a[@href="fn.my_function.html"]/code' 'my_function()' + my_macro!(); +} + +pub mod two { + //@ has 'foo/two/index.html' + //@ has - '//dl[@class="item-table"]/dd[1]/a[@href="fn.my_function.html"]/code' 'my_function' + //@ has - '//dl[@class="item-table"]/dd[2]/a[@href="fn.my_function.html"]/code' 'my_function()' + my_macro!(); +} |
