Skip to content

Commit 33a5d00

Browse files
committed
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.
1 parent ee3a0f8 commit 33a5d00

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

src/test/rustdoc/auxiliary/my-core.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(no_core, lang_items)]
2+
#![no_core]
3+
4+
#[lang = "char"]
5+
impl char {
6+
pub fn len_utf8(self) -> usize {
7+
42
8+
}
9+
}
10+
11+
#[lang = "sized"]
12+
pub trait Sized {}
13+
14+
#[lang = "clone"]
15+
pub trait Clone: Sized {}
16+
17+
#[lang = "copy"]
18+
pub trait Copy: Clone {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// aux-build:my-core.rs
2+
// ignore-cross-compile
3+
4+
#![deny(intra_doc_link_resolution_failure)]
5+
#![feature(no_core, lang_items)]
6+
#![no_core]
7+
8+
//! A [`char`] and its [`char::len_utf8`].
9+
10+
extern crate my_core;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#![deny(intra_doc_link_resolution_failure)]
2+
#![feature(no_core, lang_items)]
3+
#![no_core]
4+
5+
//! A [`char`] and its [`char::len_utf8`].
6+
7+
#[lang = "char"]
8+
impl char {
9+
pub fn len_utf8(self) -> usize {
10+
42
11+
}
12+
}
13+
14+
#[lang = "sized"]
15+
pub trait Sized {}
16+
17+
#[lang = "clone"]
18+
pub trait Clone: Sized {}
19+
20+
#[lang = "copy"]
21+
pub trait Copy: Clone {}

0 commit comments

Comments
 (0)