Two new rustdoc tests for intra links
They both produce less-than-desirable output (links going to docs.rust-lang.org), but I haven't figured out yet how to assert about them properly.
This commit is contained in:
parent
ee3a0f867e
commit
33a5d00efb
3 changed files with 49 additions and 0 deletions
18
src/test/rustdoc/auxiliary/my-core.rs
Normal file
18
src/test/rustdoc/auxiliary/my-core.rs
Normal file
|
@ -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 {}
|
10
src/test/rustdoc/intra-link-prim-methods-external-core.rs
Normal file
10
src/test/rustdoc/intra-link-prim-methods-external-core.rs
Normal file
|
@ -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;
|
21
src/test/rustdoc/intra-link-prim-methods-local.rs
Normal file
21
src/test/rustdoc/intra-link-prim-methods-local.rs
Normal file
|
@ -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 {}
|
Loading…
Add table
Add a link
Reference in a new issue