Skip to content

Commit

Permalink
Two new rustdoc tests for intra links
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sethp committed Jul 7, 2020
1 parent ee3a0f8 commit 33a5d00
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/test/rustdoc/auxiliary/my-core.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions src/test/rustdoc/intra-link-prim-methods-external-core.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 21 additions & 0 deletions src/test/rustdoc/intra-link-prim-methods-local.rs
Original file line number Diff line number Diff line change
@@ -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 {}

0 comments on commit 33a5d00

Please sign in to comment.