diff options
| author | Ben Kimock <kimockb@gmail.com> | 2025-08-10 01:45:38 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 01:45:38 +0000 |
| commit | 85c8d7089035d60c63a0594b07ff48981399f2ed (patch) | |
| tree | f126cf7695965577ab96b9c27e5a9c5c491f8dd2 /tests/rustdoc | |
| parent | ee1b237215ee90df2c0102457fa2d0e9c2df8753 (diff) | |
| parent | 6e83b592cddec5ab61f1e4307134fd8f4069351e (diff) | |
| download | rust-85c8d7089035d60c63a0594b07ff48981399f2ed.tar.gz rust-85c8d7089035d60c63a0594b07ff48981399f2ed.zip | |
Merge pull request #4518 from rust-lang/rustup-2025-08-09
Automatic Rustup
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!(); +} |
