diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-05-02 15:07:11 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2022-05-06 22:02:04 +0200 |
| commit | fd6b01f0e993eecd1d0eecc00b6cb53f6e0d0c0c (patch) | |
| tree | b7dae34c56c369abbc84fb2541683c89f8c60d9f | |
| parent | 5c7ce84d7409075803bf44bc38d3d212fa83feef (diff) | |
| download | rust-fd6b01f0e993eecd1d0eecc00b6cb53f6e0d0c0c.tar.gz rust-fd6b01f0e993eecd1d0eecc00b6cb53f6e0d0c0c.zip | |
Add regression test for jump-to-def
| -rw-r--r-- | src/test/rustdoc/check-source-code-urls-to-def.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/rustdoc/check-source-code-urls-to-def.rs b/src/test/rustdoc/check-source-code-urls-to-def.rs index ca4179d403d..12c5df2871c 100644 --- a/src/test/rustdoc/check-source-code-urls-to-def.rs +++ b/src/test/rustdoc/check-source-code-urls-to-def.rs @@ -46,6 +46,24 @@ pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::Sour // @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14-16"]' 'Trait' pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {} +pub trait AnotherTrait {} +pub trait WhyNot {} + +// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#49"]' 'AnotherTrait' +// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#50"]' 'WhyNot' +pub fn foo3<T, V>(t: &T, v: &V) +where + T: AnotherTrait, + V: WhyNot +{} + +pub trait AnotherTrait2 {} + +// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#60"]' 'AnotherTrait2' +pub fn foo4() { + let x: Vec<AnotherTrait2> = Vec::new(); +} + // @has - '//a[@href="../../foo/primitive.bool.html"]' 'bool' #[doc(primitive = "bool")] mod whatever {} |
