Skip to content

Commit 978100d

Browse files
committed
rustdoc: update no_core tests w/ new traits
Some rustdoc tests are `no_core` and need to have `MetaSized` and `PointeeSized` added to them. One or two tests used extern types and needed further relaxations to work as before.
1 parent fdfc254 commit 978100d

15 files changed

+137
-17
lines changed

tests/rustdoc-json/impls/auto.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#![feature(no_core, auto_traits, lang_items, arbitrary_self_types)]
2+
#![feature(const_trait_impl)]
23
#![no_core]
34

5+
#[lang = "pointeesized"]
6+
pub trait PointeeSized {}
7+
8+
#[lang = "metasized"]
9+
#[const_trait]
10+
pub trait MetaSized: PointeeSized {}
11+
412
#[lang = "sized"]
5-
trait Sized {}
13+
#[const_trait]
14+
pub trait Sized: MetaSized {}
615

716
#[lang = "legacy_receiver"]
817
pub trait LegacyReceiver {}

tests/rustdoc-json/primitives/primitive_impls.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
#![feature(no_core, lang_items)]
2+
#![feature(const_trait_impl)]
23
#![feature(rustc_attrs)]
34
#![feature(rustdoc_internals)]
45
#![no_core]
56
#![rustc_coherence_is_core]
67

78
//@ set impl_i32 = "$.index[*][?(@.docs=='Only core can do this')].id"
89

10+
#[lang = "pointeesized"]
11+
pub trait PointeeSized {}
12+
13+
#[lang = "metasized"]
14+
#[const_trait]
15+
pub trait MetaSized: PointeeSized {}
16+
917
#[lang = "sized"]
10-
trait Sized {}
18+
#[const_trait]
19+
pub trait Sized: MetaSized {}
1120

1221
/// Only core can do this
1322
impl i32 {

tests/rustdoc-ui/custom_code_classes_in_docs-warning3.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33

44
#![deny(warnings)]
55
#![feature(no_core, lang_items)]
6+
#![feature(const_trait_impl)]
67
#![no_core]
78

9+
#[lang = "pointeesized"]
10+
pub trait PointeeSized {}
11+
12+
#[lang = "metasized"]
13+
#[const_trait]
14+
pub trait MetaSized: PointeeSized {}
15+
816
#[lang = "sized"]
9-
trait Sized {}
17+
#[const_trait]
18+
pub trait Sized: MetaSized {}
1019

1120
/// ```{class="}
1221
/// main;

tests/rustdoc/cfg_doc_reexport.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
#![feature(doc_cfg)]
22
#![feature(no_core, lang_items)]
3+
#![feature(const_trait_impl)]
34

45
#![crate_name = "foo"]
56
#![no_core]
67

8+
#[lang = "pointeesized"]
9+
pub trait PointeeSized {}
10+
11+
#[lang = "metasized"]
12+
#[const_trait]
13+
pub trait MetaSized: PointeeSized {}
14+
715
#[lang = "sized"]
8-
trait Sized {}
16+
#[const_trait]
17+
pub trait Sized: MetaSized {}
918

1019
//@ has 'foo/index.html'
1120
//@ has - '//dt/*[@class="stab portability"]' 'foobar'

tests/rustdoc/cross-crate-primitive-doc.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
//@ only-linux
44

55
#![feature(no_core, lang_items)]
6+
#![feature(const_trait_impl)]
67
#![no_core]
78

9+
#[lang = "pointeesized"]
10+
pub trait PointeeSized {}
11+
12+
#[lang = "metasized"]
13+
#[const_trait]
14+
pub trait MetaSized: PointeeSized {}
15+
816
#[lang = "sized"]
9-
trait Sized {}
17+
#[const_trait]
18+
pub trait Sized: MetaSized {}
1019

1120
extern crate primitive_doc;
1221

tests/rustdoc/file-creation-111249.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
// https://github.com/rust-lang/rust/issues/111249
22
#![crate_name = "foo"]
33
#![feature(no_core)]
4+
#![feature(const_trait_impl, lang_items)]
45
#![no_core]
56

7+
#[lang = "pointeesized"]
8+
pub trait PointeeSized {}
9+
10+
#[lang = "metasized"]
11+
#[const_trait]
12+
pub trait MetaSized: PointeeSized {}
13+
14+
#[lang = "sized"]
15+
#[const_trait]
16+
pub trait Sized: MetaSized {}
17+
618
//@ files "foo" "['all.html', 'visible', 'index.html', 'sidebar-items.js', 'hidden', \
7-
// 'struct.Bar.html']"
19+
// 'struct.Bar.html', 'trait.Sized.html', 'trait.MetaSized.html', 'trait.PointeeSized.html']"
820
//@ files "foo/visible" "['trait.Foo.html', 'index.html', 'sidebar-items.js']"
921
//@ files "foo/hidden" "['inner']"
1022
//@ files "foo/hidden/inner" "['trait.Foo.html']"

tests/rustdoc/foreigntype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl ExtType {
1010
pub fn do_something(&self) {}
1111
}
1212

13-
pub trait Trait {}
13+
pub trait Trait: std::marker::PointeeSized {}
1414

1515
//@ has foreigntype/trait.Trait.html '//a[@class="foreigntype"]' 'ExtType'
1616
impl Trait for ExtType {}

tests/rustdoc/intra-doc/auxiliary/my-core.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(no_core, lang_items, rustdoc_internals, rustc_attrs)]
2+
#![feature(const_trait_impl)]
23
#![no_core]
34
#![rustc_coherence_is_core]
45
#![crate_type="rlib"]
@@ -13,8 +14,16 @@ impl char {
1314
}
1415
}
1516

17+
#[lang = "pointeesized"]
18+
pub trait PointeeSized {}
19+
20+
#[lang = "metasized"]
21+
#[const_trait]
22+
pub trait MetaSized: PointeeSized {}
23+
1624
#[lang = "sized"]
17-
pub trait Sized {}
25+
#[const_trait]
26+
pub trait Sized: MetaSized {}
1827

1928
#[lang = "clone"]
2029
pub trait Clone: Sized {}

tests/rustdoc/intra-doc/extern-type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ extern {
44
pub type ExternType;
55
}
66

7-
pub trait T {
7+
pub trait T: std::marker::PointeeSized {
88
fn test(&self) {}
99
}
1010

11-
pub trait G<N> {
11+
pub trait G<N>: std::marker::PointeeSized {
1212
fn g(&self, n: N) {}
1313
}
1414

tests/rustdoc/intra-doc/no-doc-primitive.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#![deny(rustdoc::broken_intra_doc_links)]
44
#![feature(no_core, lang_items, rustc_attrs)]
5+
#![feature(const_trait_impl)]
56
#![no_core]
67
#![rustc_coherence_is_core]
78
#![crate_type = "rlib"]
@@ -10,8 +11,16 @@
1011
//@ has no_doc_primitive/index.html
1112
//! A [`char`] and its [`char::len_utf8`].
1213
14+
#[lang = "pointeesized"]
15+
pub trait PointeeSized {}
16+
17+
#[lang = "metasized"]
18+
#[const_trait]
19+
pub trait MetaSized: PointeeSized {}
20+
1321
#[lang = "sized"]
14-
trait Sized {}
22+
#[const_trait]
23+
pub trait Sized: MetaSized {}
1524

1625
impl char {
1726
pub fn len_utf8(self) -> usize {

0 commit comments

Comments
 (0)