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#88033 - GuillaumeGomez:jump-to-def-primitiv…
…e, r=jyn514 Add links for primitives in "jump to definition" feature Follow-up of rust-lang#84176. I created a function `primitive_from_str` which is code that was originally in `collect_intra_doc_links::resolve_primitive` to prevent code duplication. I also created the `primitive_link_url` function which is somewhat similar to `primitive_link` but too much different to merge both of them. r? ``@jyn514``
- Loading branch information
Showing
4 changed files
with
43 additions
and
8 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,17 @@ | ||
// compile-flags: -Zunstable-options --generate-link-to-definition | ||
|
||
#![crate_name = "foo"] | ||
|
||
// @has 'src/foo/check-source-code-urls-to-def-std.rs.html' | ||
|
||
fn babar() {} | ||
|
||
// @has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32' | ||
// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str' | ||
// @has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool' | ||
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#7"]' 'babar' | ||
pub fn foo(a: u32, b: &str, c: String) { | ||
let x = 12; | ||
let y: bool = true; | ||
babar(); | ||
} |
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