-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #74077 - sethp:docs/fix-intra-doc-primitive-link, r=j…
…yn514 Use relative path for local links to primitives Else, links to `char::foo` would point into `/path/to/src/libcore/std/primitive.char.html#method.foo`. Split out from #73804.
- Loading branch information
Showing
5 changed files
with
77 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
#![crate_type="rlib"] | ||
|
||
#[lang = "char"] | ||
impl char { | ||
pub fn len_utf8(self) -> usize { | ||
42 | ||
} | ||
} | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
#[lang = "clone"] | ||
pub trait Clone: Sized {} | ||
|
||
#[lang = "copy"] | ||
pub trait Copy: Clone {} |
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,18 @@ | ||
// aux-build:my-core.rs | ||
// build-aux-docs | ||
// ignore-cross-compile | ||
// ignore-windows | ||
// ignore-tidy-linelength | ||
|
||
#![deny(intra_doc_link_resolution_failure)] | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
#![crate_type = "rlib"] | ||
|
||
// @has intra_link_prim_methods_external_core/index.html | ||
// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html"]' 'char' | ||
// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.len_utf8"]' 'char::len_utf8' | ||
|
||
//! A [`char`] and its [`char::len_utf8`]. | ||
extern crate my_core; |
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,28 @@ | ||
#![deny(intra_doc_link_resolution_failure)] | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
#![crate_type = "rlib"] | ||
|
||
// ignore-tidy-linelength | ||
|
||
// @has intra_link_prim_methods_local/index.html | ||
// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html"]' 'char' | ||
// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.len_utf8"]' 'char::len_utf8' | ||
|
||
//! A [`char`] and its [`char::len_utf8`]. | ||
#[lang = "char"] | ||
impl char { | ||
pub fn len_utf8(self) -> usize { | ||
42 | ||
} | ||
} | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
#[lang = "clone"] | ||
pub trait Clone: Sized {} | ||
|
||
#[lang = "copy"] | ||
pub trait Copy: Clone {} |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
#![deny(intra_doc_link_resolution_failure)] | ||
|
||
// ignore-tidy-linelength | ||
|
||
// @has intra_link_prim_methods/index.html | ||
// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html"]' 'char' | ||
// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html#method.len_utf8"]' 'char::len_utf8' | ||
|
||
//! A [`char`] and its [`char::len_utf8`]. |