diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-18 17:57:27 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-11-18 18:11:50 +0100 |
| commit | 8b0f8cb73c29b9466d817c3d7fda4ff52b90c4a7 (patch) | |
| tree | 850e829afa739271c04f71e07a7f6eb2a9ecf784 /tests/rustdoc/link-on-path-with-generics.rs | |
| parent | 786b7477f6d40e0b79cd15dff0301a4aa53d7daf (diff) | |
| download | rust-8b0f8cb73c29b9466d817c3d7fda4ff52b90c4a7.tar.gz rust-8b0f8cb73c29b9466d817c3d7fda4ff52b90c4a7.zip | |
Add regression test for jump to def links on items with generics
Diffstat (limited to 'tests/rustdoc/link-on-path-with-generics.rs')
| -rw-r--r-- | tests/rustdoc/link-on-path-with-generics.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/rustdoc/link-on-path-with-generics.rs b/tests/rustdoc/link-on-path-with-generics.rs new file mode 100644 index 00000000000..22ba36c9f15 --- /dev/null +++ b/tests/rustdoc/link-on-path-with-generics.rs @@ -0,0 +1,14 @@ +// This test ensures that paths with generics still get their link to their definition +// correctly generated. + +//@ compile-flags: -Zunstable-options --generate-link-to-definition +#![crate_name = "foo"] + +//@ has 'src/foo/link-on-path-with-generics.rs.html' + +pub struct Soyo<T>(T); +pub struct Saya; + +//@ has - '//pre[@class="rust"]//a[@href="#9"]' 'Soyo' +//@ has - '//pre[@class="rust"]//a[@href="#10"]' 'Saya' +pub fn bar<T>(s: Soyo<T>, x: Saya) {} |
