Skip to content

Commit eda2a94

Browse files
committed
rustdoc: {Meta,Pointee,}Sized in non-minicore
Some rustdoc tests are `no_core` and need to have `MetaSized` and `PointeeSized` added to them.
1 parent 2e465db commit eda2a94

16 files changed

+109
-21
lines changed

tests/rustdoc-json/impls/auto.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#![feature(no_core, auto_traits, lang_items, arbitrary_self_types)]
22
#![no_core]
33

4+
#[lang = "pointee_sized"]
5+
pub trait PointeeSized {}
6+
7+
#[lang = "meta_sized"]
8+
pub trait MetaSized: PointeeSized {}
9+
410
#[lang = "sized"]
5-
trait Sized {}
11+
pub trait Sized: MetaSized {}
612

713
#[lang = "legacy_receiver"]
814
pub trait LegacyReceiver {}
@@ -15,8 +21,8 @@ impl Foo {
1521
}
1622

1723
// Testing spans, so all tests below code
18-
//@ is "$.index[?(@.docs=='has span')].span.begin" "[13, 1]"
19-
//@ is "$.index[?(@.docs=='has span')].span.end" "[15, 2]"
24+
//@ is "$.index[?(@.docs=='has span')].span.begin" "[19, 1]"
25+
//@ is "$.index[?(@.docs=='has span')].span.end" "[21, 2]"
2026
//@ is "$.index[?(@.docs=='has span')].inner.impl.is_synthetic" false
2127
//@ is "$.index[?(@.inner.impl.is_synthetic==true)].span" null
2228
//@ is "$.index[?(@.inner.impl.is_synthetic==true)].inner.impl.for.resolved_path.path" '"Foo"'

tests/rustdoc-json/primitives/primitive_impls.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66

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

9+
#[lang = "pointee_sized"]
10+
pub trait PointeeSized {}
11+
12+
#[lang = "meta_sized"]
13+
pub trait MetaSized: PointeeSized {}
14+
915
#[lang = "sized"]
10-
trait Sized {}
16+
pub trait Sized: MetaSized {}
1117

1218
/// Only core can do this
1319
impl i32 {

tests/rustdoc-ui/custom_code_classes_in_docs-warning3.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
#![feature(no_core, lang_items)]
66
#![no_core]
77

8+
#[lang = "pointee_sized"]
9+
pub trait PointeeSized {}
10+
11+
#[lang = "meta_sized"]
12+
pub trait MetaSized: PointeeSized {}
13+
814
#[lang = "sized"]
9-
trait Sized {}
15+
pub trait Sized: MetaSized {}
1016

1117
/// ```{class="}
1218
/// main;

tests/rustdoc-ui/custom_code_classes_in_docs-warning3.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unclosed quote string `"`
2-
--> $DIR/custom_code_classes_in_docs-warning3.rs:11:1
2+
--> $DIR/custom_code_classes_in_docs-warning3.rs:17:1
33
|
44
LL | / /// ```{class="}
55
LL | | /// main;
@@ -17,7 +17,7 @@ LL | #![deny(warnings)]
1717
= note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(warnings)]`
1818

1919
error: unclosed quote string `"`
20-
--> $DIR/custom_code_classes_in_docs-warning3.rs:11:1
20+
--> $DIR/custom_code_classes_in_docs-warning3.rs:17:1
2121
|
2222
LL | / /// ```{class="}
2323
LL | | /// main;

tests/rustdoc-ui/target-feature-stability.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@
1414
#![feature(arm_target_feature)]
1515
#![no_core]
1616

17+
#[lang = "pointee_sized"]
18+
pub trait PointeeSized {}
19+
20+
#[lang = "meta_sized"]
21+
pub trait MetaSized: PointeeSized {}
22+
1723
#[lang = "sized"]
18-
pub trait Sized {}
24+
pub trait Sized: MetaSized {}
1925

2026
// `fp-armv8` is "forbidden" on aarch64 as we tie it to `neon`.
2127
#[target_feature(enable = "fp-armv8")]

tests/rustdoc/file-creation-111249.rs

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

7+
#[lang = "pointee_sized"]
8+
pub trait PointeeSized {}
9+
10+
#[lang = "meta_sized"]
11+
pub trait MetaSized: PointeeSized {}
12+
13+
#[lang = "sized"]
14+
pub trait Sized: MetaSized {}
15+
616
//@ files "foo" "['all.html', 'visible', 'index.html', 'sidebar-items.js', 'hidden', \
7-
// 'struct.Bar.html']"
17+
// 'struct.Bar.html', 'trait.Sized.html', 'trait.MetaSized.html', 'trait.PointeeSized.html']"
818
//@ files "foo/visible" "['trait.Foo.html', 'index.html', 'sidebar-items.js']"
919
//@ files "foo/hidden" "['inner']"
1020
//@ files "foo/hidden/inner" "['trait.Foo.html']"

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ impl char {
1313
}
1414
}
1515

16+
#[lang = "pointee_sized"]
17+
pub trait PointeeSized {}
18+
19+
#[lang = "meta_sized"]
20+
pub trait MetaSized: PointeeSized {}
21+
1622
#[lang = "sized"]
17-
pub trait Sized {}
23+
pub trait Sized: MetaSized {}
1824

1925
#[lang = "clone"]
2026
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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@
1010
//@ has no_doc_primitive/index.html
1111
//! A [`char`] and its [`char::len_utf8`].
1212
13+
#[lang = "pointee_sized"]
14+
pub trait PointeeSized {}
15+
16+
#[lang = "meta_sized"]
17+
pub trait MetaSized: PointeeSized {}
18+
1319
#[lang = "sized"]
14-
trait Sized {}
20+
pub trait Sized: MetaSized {}
1521

1622
impl char {
1723
pub fn len_utf8(self) -> usize {

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ impl char {
1919
}
2020
}
2121

22+
#[lang = "pointee_sized"]
23+
pub trait PointeeSized {}
24+
25+
#[lang = "meta_sized"]
26+
pub trait MetaSized: PointeeSized {}
27+
2228
#[lang = "sized"]
23-
pub trait Sized {}
29+
pub trait Sized: MetaSized {}
2430

2531
#[lang = "clone"]
2632
pub trait Clone: Sized {}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,11 @@ impl S {
3737
pub fn f() {}
3838
}
3939

40+
#[lang = "pointee_sized"]
41+
pub trait PointeeSized {}
42+
43+
#[lang = "meta_sized"]
44+
pub trait MetaSized: PointeeSized {}
45+
4046
#[lang = "sized"]
41-
pub trait Sized {}
47+
pub trait Sized: MetaSized {}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ impl<T> Box<T> {
1111
}
1212
}
1313

14+
#[lang = "pointee_sized"]
15+
pub trait PointeeSized {}
16+
17+
#[lang = "meta_sized"]
18+
pub trait MetaSized: PointeeSized {}
19+
1420
#[lang = "sized"]
15-
trait Sized {}
21+
pub trait Sized: MetaSized {}
1622

1723
#[doc(notable_trait)]
1824
pub trait FakeIterator {}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
#![feature(no_core, lang_items)]
66
#![no_core]
77

8+
#[lang = "pointee_sized"]
9+
pub trait PointeeSized {}
10+
11+
#[lang = "meta_sized"]
12+
pub trait MetaSized: PointeeSized {}
13+
814
#[lang = "sized"]
9-
trait Sized {}
15+
pub trait Sized: MetaSized {}
1016

1117
extern crate primitive_doc;
1218

tests/rustdoc/reexport/cfg_doc_reexport.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
#![crate_name = "foo"]
55
#![no_core]
66

7+
#[lang = "pointee_sized"]
8+
pub trait PointeeSized {}
9+
10+
#[lang = "meta_sized"]
11+
pub trait MetaSized: PointeeSized {}
12+
713
#[lang = "sized"]
8-
trait Sized {}
14+
pub trait Sized: MetaSized {}
915

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

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
#![no_core]
44
#![crate_name = "foo"]
55

6+
#[lang = "pointee_sized"]
7+
pub trait PointeeSized {}
8+
9+
#[lang = "meta_sized"]
10+
pub trait MetaSized: PointeeSized {}
11+
612
#[lang = "sized"]
7-
trait Sized {}
13+
pub trait Sized: MetaSized {}
814

915
//@ files "foo" "['sidebar-items.js', 'all.html', 'hidden', 'index.html', 'struct.Bar.html', \
10-
// 'visible']"
16+
// 'visible', 'trait.Sized.html', 'trait.MetaSized.html', 'trait.PointeeSized.html']"
1117
//@ files "foo/hidden" "['inner']"
1218
//@ files "foo/hidden/inner" "['trait.Foo.html']"
1319
//@ files "foo/visible" "['index.html', 'sidebar-items.js', 'trait.Foo.html']"

tests/rustdoc/safe-intrinsic.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
#![no_core]
66
#![crate_name = "foo"]
77

8+
#[lang = "pointee_sized"]
9+
pub trait PointeeSized {}
10+
11+
#[lang = "meta_sized"]
12+
pub trait MetaSized: PointeeSized {}
13+
814
#[lang = "sized"]
9-
trait Sized {}
15+
pub trait Sized: MetaSized {}
1016

1117
//@ has 'foo/fn.abort.html'
1218
//@ has - '//pre[@class="rust item-decl"]' 'pub fn abort() -> !'

0 commit comments

Comments
 (0)