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

+10-1
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

+10-1
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

+10-1
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

+10-1
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

+10-1
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

+13-1
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

+1-1
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

+10-1
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

+2-2
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

+10-1
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 {

tests/rustdoc/intra-doc/prim-methods-local.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![deny(rustdoc::broken_intra_doc_links)]
22
#![feature(no_core, lang_items, rustc_attrs, rustdoc_internals)]
3+
#![feature(const_trait_impl)]
34
#![no_core]
45
#![rustc_coherence_is_core]
56
#![crate_type = "rlib"]
@@ -19,8 +20,16 @@ impl char {
1920
}
2021
}
2122

23+
#[lang = "pointeesized"]
24+
pub trait PointeeSized {}
25+
26+
#[lang = "metasized"]
27+
#[const_trait]
28+
pub trait MetaSized: PointeeSized {}
29+
2230
#[lang = "sized"]
23-
pub trait Sized {}
31+
#[const_trait]
32+
pub trait Sized: MetaSized {}
2433

2534
#[lang = "clone"]
2635
pub trait Clone: Sized {}

tests/rustdoc/intra-doc/prim-self.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![feature(no_core)]
66
#![feature(rustdoc_internals)]
77
#![feature(inherent_associated_types)]
8+
#![feature(const_trait_impl)]
89
#![feature(lang_items)]
910
#![no_core]
1011

@@ -37,5 +38,13 @@ impl S {
3738
pub fn f() {}
3839
}
3940

41+
#[lang = "pointeesized"]
42+
pub trait PointeeSized {}
43+
44+
#[lang = "metasized"]
45+
#[const_trait]
46+
pub trait MetaSized: PointeeSized {}
47+
4048
#[lang = "sized"]
41-
pub trait Sized {}
49+
#[const_trait]
50+
pub trait Sized: MetaSized {}

tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(doc_notable_trait)]
2+
#![feature(const_trait_impl)]
23
#![feature(lang_items)]
34
#![feature(no_core)]
45
#![no_core]
@@ -11,8 +12,16 @@ impl<T> Box<T> {
1112
}
1213
}
1314

15+
#[lang = "pointeesized"]
16+
pub trait PointeeSized {}
17+
18+
#[lang = "metasized"]
19+
#[const_trait]
20+
pub trait MetaSized: PointeeSized {}
21+
1422
#[lang = "sized"]
15-
trait Sized {}
23+
#[const_trait]
24+
pub trait Sized: MetaSized {}
1625

1726
#[doc(notable_trait)]
1827
pub trait FakeIterator {}

tests/rustdoc/reexport-trait-from-hidden-111064-2.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/111064>.
22
#![feature(no_core, lang_items)]
3+
#![feature(const_trait_impl)]
34
#![no_core]
45
#![crate_name = "foo"]
56

7+
#[lang = "pointeesized"]
8+
pub trait PointeeSized {}
9+
10+
#[lang = "metasized"]
11+
#[const_trait]
12+
pub trait MetaSized: PointeeSized {}
13+
614
#[lang = "sized"]
7-
trait Sized {}
15+
#[const_trait]
16+
pub trait Sized: MetaSized {}
817

918
//@ files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \
10-
// 'visible']"
19+
// 'visible', 'trait.Sized.html', 'trait.MetaSized.html', 'trait.PointeeSized.html']"
1120
//@ files "foo/hidden" "['inner']"
1221
//@ files "foo/hidden/inner" "['trait.Foo.html']"
1322
//@ files "foo/visible" "['index.html', 'sidebar-items.js', 'trait.Foo.html']"

tests/rustdoc/safe-intrinsic.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
#![feature(intrinsics)]
22
#![feature(no_core, lang_items)]
3+
#![feature(const_trait_impl)]
34
#![feature(rustc_attrs)]
45

56
#![no_core]
67
#![crate_name = "foo"]
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
//@ has 'foo/fn.abort.html'
1221
//@ has - '//pre[@class="rust item-decl"]' 'pub fn abort() -> !'

0 commit comments

Comments
 (0)