From 8b0f8cb73c29b9466d817c3d7fda4ff52b90c4a7 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 18 Nov 2024 17:57:27 +0100 Subject: [PATCH] Add regression test for jump to def links on items with generics --- tests/rustdoc/link-on-path-with-generics.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/rustdoc/link-on-path-with-generics.rs 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); +pub struct Saya; + +//@ has - '//pre[@class="rust"]//a[@href="#9"]' 'Soyo' +//@ has - '//pre[@class="rust"]//a[@href="#10"]' 'Saya' +pub fn bar(s: Soyo, x: Saya) {}