Skip to content

Commit

Permalink
Add regression test for jump to def links on items with generics
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 18, 2024
1 parent 786b747 commit 8b0f8cb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/rustdoc/link-on-path-with-generics.rs
Original file line number Diff line number Diff line change
@@ -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) {}

0 comments on commit 8b0f8cb

Please sign in to comment.