Skip to content

Commit 5bc7687

Browse files
Add regression test for jump to def static method calls
1 parent 35ad2ae commit 5bc7687

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

tests/rustdoc/check-source-code-urls-to-def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub trait AnotherTrait2 {}
6262

6363
// @has - '//pre[@class="rust"]//a[@href="#61"]' 'AnotherTrait2'
6464
pub fn foo4() {
65-
let x: Vec<AnotherTrait2> = Vec::new();
65+
let x: Vec<&dyn AnotherTrait2> = Vec::new();
6666
}
6767

6868
// @has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// compile-flags: -Zunstable-options --generate-link-to-definition
2+
3+
#![crate_name = "foo"]
4+
5+
// @has 'src/foo/jump-to-def-doc-links-calls.rs.html'
6+
7+
// @has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar'
8+
pub struct Bar;
9+
10+
impl std::default::Default for Bar {
11+
// @has - '//a[@href="#20-22"]' 'Self::new'
12+
fn default() -> Self {
13+
Self::new()
14+
}
15+
}
16+
17+
// @has - '//a[@href="#8"]' 'Bar'
18+
impl Bar {
19+
// @has - '//a[@href="#24-26"]' 'Self::bar'
20+
pub fn new()-> Self {
21+
Self::bar()
22+
}
23+
24+
pub fn bar() -> Self {
25+
Self
26+
}
27+
}

0 commit comments

Comments
 (0)