Skip to content

Commit fd6b01f

Browse files
Add regression test for jump-to-def
1 parent 5c7ce84 commit fd6b01f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/rustdoc/check-source-code-urls-to-def.rs

+18
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@ pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::Sour
4646
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait'
4747
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
4848

49+
pub trait AnotherTrait {}
50+
pub trait WhyNot {}
51+
52+
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#49"]' 'AnotherTrait'
53+
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#50"]' 'WhyNot'
54+
pub fn foo3<T, V>(t: &T, v: &V)
55+
where
56+
T: AnotherTrait,
57+
V: WhyNot
58+
{}
59+
60+
pub trait AnotherTrait2 {}
61+
62+
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#60"]' 'AnotherTrait2'
63+
pub fn foo4() {
64+
let x: Vec<AnotherTrait2> = Vec::new();
65+
}
66+
4967
// @has - '//a[@href="../../foo/primitive.bool.html"]' 'bool'
5068
#[doc(primitive = "bool")]
5169
mod whatever {}

0 commit comments

Comments
 (0)