diff --git a/src/test/rustdoc/auxiliary/my-core.rs b/src/test/rustdoc/auxiliary/my-core.rs new file mode 100644 index 0000000000000..999dfbdd8a3f5 --- /dev/null +++ b/src/test/rustdoc/auxiliary/my-core.rs @@ -0,0 +1,18 @@ +#![feature(no_core, lang_items)] +#![no_core] + +#[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 {} diff --git a/src/test/rustdoc/intra-link-prim-methods-external-core.rs b/src/test/rustdoc/intra-link-prim-methods-external-core.rs new file mode 100644 index 0000000000000..85e017e89b146 --- /dev/null +++ b/src/test/rustdoc/intra-link-prim-methods-external-core.rs @@ -0,0 +1,10 @@ +// aux-build:my-core.rs +// ignore-cross-compile + +#![deny(intra_doc_link_resolution_failure)] +#![feature(no_core, lang_items)] +#![no_core] + +//! A [`char`] and its [`char::len_utf8`]. + +extern crate my_core; diff --git a/src/test/rustdoc/intra-link-prim-methods-local.rs b/src/test/rustdoc/intra-link-prim-methods-local.rs new file mode 100644 index 0000000000000..c0be16885dae8 --- /dev/null +++ b/src/test/rustdoc/intra-link-prim-methods-local.rs @@ -0,0 +1,21 @@ +#![deny(intra_doc_link_resolution_failure)] +#![feature(no_core, lang_items)] +#![no_core] + +//! 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 {}