forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#119586 - GuillaumeGomez:jump-to-def-static-…
…methods, r=notriddle [rustdoc] Fix invalid handling for static method calls in jump to definition feature I realized when working on a clippy lint that static method calls on `Self` could not give me the method `Res`. For that, we need to use `typeck` and so that's what I did in here. It fixes the linking to static method calls. r? ```@notriddle```
- Loading branch information
Showing
3 changed files
with
60 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// compile-flags: -Zunstable-options --generate-link-to-definition | ||
|
||
#![crate_name = "foo"] | ||
|
||
// @has 'src/foo/jump-to-def-doc-links-calls.rs.html' | ||
|
||
// @has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar' | ||
pub struct Bar; | ||
|
||
impl std::default::Default for Bar { | ||
// @has - '//a[@href="#20-22"]' 'Self::new' | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} | ||
|
||
// @has - '//a[@href="#8"]' 'Bar' | ||
impl Bar { | ||
// @has - '//a[@href="#24-26"]' 'Self::bar' | ||
pub fn new()-> Self { | ||
Self::bar() | ||
} | ||
|
||
pub fn bar() -> Self { | ||
Self | ||
} | ||
} |