Skip to content

Commit f784fa7

Browse files
committed
tests/rustdoc-json: Remove some needless uses of #![no_core].
Done by removing all uses of `#![no_core]`, and the reverting the ones that failed. More involved ones are in a later commit.
1 parent 187d1af commit f784fa7

40 files changed

+9
-126
lines changed

tests/rustdoc-json/doc_hidden_failure.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/98007>.
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
mod auto {
74
mod action_row {
85
pub struct ActionRowBuilder;

tests/rustdoc-json/enums/use_glob.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/104942>
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @set Color = "$.index[*][?(@.name == 'Color')].id"
74
pub enum Color {
85
Red,

tests/rustdoc-json/enums/use_variant.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(no_core)]
2-
#![no_core]
3-
41
// @set AlwaysNone = "$.index[*][?(@.name == 'AlwaysNone')].id"
52
pub enum AlwaysNone {
63
// @set None = "$.index[*][?(@.name == 'None')].id"

tests/rustdoc-json/fn_pointer/generics.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @count "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type_alias.type.function_pointer.decl.inputs[*]" 1
74
// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type_alias.type.function_pointer.decl.inputs[0][0]" '"val"'
85
// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type_alias.type.function_pointer.decl.inputs[0][1].borrowed_ref.lifetime" \"\'c\"

tests/rustdoc-json/fns/extern_c_variadic.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(no_core)]
2-
#![no_core]
3-
41
extern "C" {
52
// @is "$.index[*][?(@.name == 'not_variadic')].inner.function.decl.c_variadic" false
63
pub fn not_variadic(_: i32);

tests/rustdoc-json/fns/generic_args.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @set foo = "$.index[*][?(@.name=='Foo')].id"
74
pub trait Foo {}
85

tests/rustdoc-json/fns/generic_returns.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @count "$.index[*][?(@.name=='generic_returns')].inner.module.items[*]" 2
74

85
// @set foo = "$.index[*][?(@.name=='Foo')].id"

tests/rustdoc-json/fns/generics.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @set wham_id = "$.index[*][?(@.name=='Wham')].id"
74
pub trait Wham {}
85

tests/rustdoc-json/glob_import.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// This is a regression test for <https://github.com/rust-lang/rust/issues/98003>.
22

3-
#![feature(no_core)]
43
#![no_std]
5-
#![no_core]
64

75
// @has "$.index[*][?(@.name=='glob')]"
86
// @has "$.index[*][?(@.inner.import)].inner.import.name" \"*\"
97

10-
118
mod m1 {
129
pub fn f() {}
1310
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(no_core)]
2-
#![no_core]
3-
41
pub struct Foo;
52

63
/// impl Foo priv
@@ -9,18 +6,16 @@ impl Foo {
96
}
107
// @!has '$.index[*][?(@.docs=="impl Foo priv")]'
118

12-
139
/// impl Foo pub
1410
impl Foo {
1511
pub fn qux() {}
1612
}
1713
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
1814

19-
2015
/// impl Foo hidden
2116
impl Foo {
2217
#[doc(hidden)]
23-
pub fn __quazl(){}
18+
pub fn __quazl() {}
2419
}
2520
// FIXME(#111564): Is this the right behaviour?
2621
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// compile-flags: --document-hidden-items
2-
#![feature(no_core)]
3-
#![no_core]
42

53
pub struct Foo;
64

@@ -11,18 +9,16 @@ impl Foo {
119
// FIXME(#111564): Is this the right behaviour?
1210
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
1311

14-
1512
/// impl Foo pub
1613
impl Foo {
1714
pub fn qux() {}
1815
}
1916
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
2017

21-
2218
/// impl Foo hidden
2319
impl Foo {
2420
#[doc(hidden)]
25-
pub fn __quazl(){}
21+
pub fn __quazl() {}
2622
}
2723
// FIXME(#111564): Is this the right behaviour?
2824
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// compile-flags: --document-private-items
2-
#![feature(no_core)]
3-
#![no_core]
42

53
pub struct Foo;
64

@@ -10,18 +8,16 @@ impl Foo {
108
}
119
// @is '$.index[*][?(@.docs=="impl Foo priv")].visibility' '"default"'
1210

13-
1411
/// impl Foo pub
1512
impl Foo {
1613
pub fn qux() {}
1714
}
1815
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'
1916

20-
2117
/// impl Foo hidden
2218
impl Foo {
2319
#[doc(hidden)]
24-
pub fn __quazl(){}
20+
pub fn __quazl() {}
2521
}
2622
// FIXME(#111564): Is this the right behaviour?
2723
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'

tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// compile-flags: --document-hidden-items
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @has "$.index[*][?(@.name == 'HiddenPubStruct')]"
74
// @has "$.index[*][?(@.inner.impl)]"
85
// @has "$.index[*][?(@.name=='PubTrait')]"

tests/rustdoc-json/impls/local_for_local_primitive.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![feature(no_core)]
21
#![feature(rustc_attrs)]
3-
#![no_core]
42

53
// @set Local = "$.index[*][?(@.name=='Local')].id"
64
pub trait Local {}

tests/rustdoc-json/lifetime/longest.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @is "$.index[*][?(@.name=='longest')].inner.function.generics.params[0].name" \"\'a\"
74
// @is "$.index[*][?(@.name=='longest')].inner.function.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
85
// @is "$.index[*][?(@.name=='longest')].inner.function.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
@@ -26,5 +23,9 @@
2623
// @is "$.index[*][?(@.name=='longest')].inner.function.decl.output.borrowed_ref.type.primitive" \"str\"
2724

2825
pub fn longest<'a>(l: &'a str, r: &'a str) -> &'a str {
29-
if l.len() > r.len() { l } else { r }
26+
if l.len() > r.len() {
27+
l
28+
} else {
29+
r
30+
}
3031
}

tests/rustdoc-json/lifetime/outlives.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @count "$.index[*][?(@.name=='foo')].inner.function.generics.params[*]" 3
74
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates" []
85
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.params[0].name" \"\'a\"

tests/rustdoc-json/methods/abi.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// ignore-tidy-linelength
22

33
#![feature(abi_vectorcall)]
4-
#![feature(no_core)]
5-
#![no_core]
64

75
// @has "$.index[*][?(@.name=='Foo')]"
86
pub struct Foo;

tests/rustdoc-json/primitives/primitive_overloading.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
// Regression test for <https://github.com/rust-lang/rust/issues/98006>.
44

55
#![feature(rustc_attrs)]
6-
#![feature(no_core)]
7-
8-
#![no_core]
96

107
// @has "$.index[*][?(@.name=='usize')]"
118
// @has "$.index[*][?(@.name=='prim')]"
129

1310
#[rustc_doc_primitive = "usize"]
1411
/// This is the built-in type `usize`.
15-
mod prim {
16-
}
12+
mod prim {}

tests/rustdoc-json/reexport/export_extern_crate_as_self.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
//! Regression test for <https://github.com/rust-lang/rust/issues/100531>
22
3-
#![feature(no_core)]
4-
#![no_core]
5-
63
#![crate_name = "export_extern_crate_as_self"]
74

85
// ignore-tidy-linelength

tests/rustdoc-json/reexport/glob_collision.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Regression test for https://github.com/rust-lang/rust/issues/100973
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
// @set m1 = "$.index[*][?(@.name == 'm1' && @.inner.module)].id"
74
// @is "$.index[*][?(@.name == 'm1')].inner.module.items" []
85
// @is "$.index[*][?(@.name == 'm1')].inner.module.is_stripped" true

tests/rustdoc-json/reexport/glob_extern.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// edition:2018
22

3-
#![no_core]
4-
#![feature(no_core)]
5-
63
// @is "$.index[*][?(@.name=='mod1')].inner.module.is_stripped" "true"
74
mod mod1 {
85
extern "C" {

tests/rustdoc-json/reexport/glob_private.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// edition:2018
22

3-
#![no_core]
4-
#![feature(no_core)]
5-
63
// @is "$.index[*][?(@.name=='mod1')].inner.module.is_stripped" "true"
74
mod mod1 {
85
// @is "$.index[*][?(@.name=='mod2')].inner.module.is_stripped" "true"

tests/rustdoc-json/reexport/in_root_and_mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(no_core)]
2-
#![no_core]
3-
41
// @!has "$.index[*][?(@.name=='foo')]"
52
mod foo {
63
// @has "$.index[*][?(@.name=='Foo')]"

tests/rustdoc-json/reexport/in_root_and_mod_pub.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(no_core)]
2-
#![no_core]
3-
41
pub mod foo {
52
// @set bar_id = "$.index[*][?(@.name=='Bar')].id"
63
// @ismany "$.index[*][?(@.name=='foo')].inner.module.items[*]" $bar_id

tests/rustdoc-json/reexport/macro.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// edition:2018
22

3-
#![no_core]
4-
#![feature(no_core)]
5-
63
// @set repro_id = "$.index[*][?(@.name=='repro')].id"
74
#[macro_export]
85
macro_rules! repro {

tests/rustdoc-json/reexport/mod_not_included.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Regression test for https://github.com/rust-lang/rust/issues/101103
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
mod m1 {
74
pub fn x() {}
85
}

tests/rustdoc-json/reexport/private_twice_one_inline.rs

-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
// Test for the ICE in https://github.com/rust-lang/rust/issues/83057
55
// An external type re-exported with different attributes shouldn't cause an error
66

7-
#![no_core]
8-
#![feature(no_core)]
9-
107
extern crate pub_struct as foo;
118
#[doc(inline)]
12-
139
// @set crate_use_id = "$.index[*][?(@.docs=='Hack A')].id"
1410
// @set foo_id = "$.index[*][?(@.docs=='Hack A')].inner.import.id"
1511
/// Hack A

tests/rustdoc-json/reexport/private_two_names.rs

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// Test for the ICE in https://github.com/rust-lang/rust/issues/83720
44
// A pub-in-private type re-exported under two different names shouldn't cause an error
55

6-
#![no_core]
7-
#![feature(no_core)]
8-
96
// @!has "$.index[*][?(@.name=='style')]"
107
mod style {
118
// @set color_struct_id = "$.index[*][?(@.inner.struct && @.name=='Color')].id"

tests/rustdoc-json/reexport/pub_use_doc_hidden.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/106379>
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
mod repeat_n {
74
#[doc(hidden)]
85
pub struct RepeatN {}

tests/rustdoc-json/reexport/rename_private.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// edition:2018
22

3-
#![no_core]
4-
#![feature(no_core)]
5-
63
// @!has "$.index[*][?(@.name=='inner')]"
74
mod inner {
85
// @has "$.index[*][?(@.name=='Public')]"

tests/rustdoc-json/reexport/rename_public.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// edition:2018
22

3-
#![no_core]
4-
#![feature(no_core)]
5-
63
// @set inner_id = "$.index[*][?(@.name=='inner')].id"
74
pub mod inner {
85
// @set public_id = "$.index[*][?(@.name=='Public')].id"

tests/rustdoc-json/reexport/same_name_different_types.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/107677>.
22

3-
#![feature(no_core)]
4-
#![no_core]
5-
63
pub mod nested {
74
// @set foo_struct = "$.index[*][?(@.docs == 'Foo the struct')].id"
85

tests/rustdoc-json/reexport/same_type_reexported_more_than_once.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
// Regression test for <https://github.com/rust-lang/rust/issues/97432>.
44

5-
#![feature(no_core)]
65
#![no_std]
7-
#![no_core]
86

97
mod inner {
108
// @set trait_id = "$.index[*][?(@.name=='Trait')].id"

tests/rustdoc-json/reexport/simple_private.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// edition:2018
2-
#![no_core]
3-
#![feature(no_core)]
42

53
// @!has "$.index[*][?(@.name=='inner')]"
64
mod inner {

tests/rustdoc-json/reexport/simple_public.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// edition:2018
22

3-
#![no_core]
4-
#![feature(no_core)]
5-
63
// @set inner_id = "$.index[*][?(@.name=='inner')].id"
74
pub mod inner {
85

tests/rustdoc-json/return_private.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/96161>.
22
// ignore-tidy-linelength
33

4-
#![feature(no_core)]
5-
#![no_core]
6-
74
mod secret {
85
pub struct Secret;
96
}

0 commit comments

Comments
 (0)