Skip to content

Commit 5d00a5d

Browse files
Rollup merge of #117679 - aDotInTheVoid:yes-core, r=GuillaumeGomez
tests/rustdoc-json: Avoid needless use of `no_core` and `lang_items` See #117487 for motivation. I've split it into three commits, depending on how much work it was to remove `#![no_core]`. The first is entirely mechanical, the second makes no logical changes but couldn't be done with find+replace, and the third required rewriting assertions no not depend on having `#![no_core]`. All of the interesting changes for review are in the third commit, so I recommend reviewing commit-by-commit. After this, 3 tests still use `#![no_core]`: - `./tests/rustdoc-json/primitives/primitive_impls.rs`. Uses impls on primitives, so needs to simulate core - `./tests/rustdoc-json/primitives/local_primitive.rs`: Uses `rustc_doc_primitive`, so needs to simulate core - `./tests/rustdoc-json/impls/auto.rs`: Uses auto traits, so needs to simulate core But after this change, we only rely on the core-rustc boundary in tests that deliberately test those interactions. r? ``@GuillaumeGomez`` Fixes #117487
2 parents c828371 + 434b69a commit 5d00a5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+41
-202
lines changed

tests/rustdoc-json/doc_hidden_failure.rs

Lines changed: 0 additions & 3 deletions
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/field_hidden.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/100529>.
22

3-
#![no_core]
4-
#![feature(no_core, lang_items)]
5-
6-
#[lang = "sized"]
7-
trait Sized {}
8-
93
// @has "$.index[*][?(@.name=='ParseError')]"
104
// @has "$.index[*][?(@.name=='UnexpectedEndTag')]"
115
// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant.kind.tuple" [null]

tests/rustdoc-json/enums/kind.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
// ignore-tidy-linelength
22

3-
#![feature(no_core, lang_items)]
4-
#![no_core]
5-
6-
#[lang = "sized"]
7-
trait Sized {}
8-
93
pub enum Foo {
104
// @set Unit = "$.index[*][?(@.name=='Unit')].id"
115
// @is "$.index[*][?(@.name=='Unit')].inner.variant.kind" '"plain"'

tests/rustdoc-json/enums/tuple_fields_hidden.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#![feature(no_core, lang_items)]
2-
#![no_core]
3-
4-
#[lang = "sized"]
5-
trait Sized {}
6-
71
// @set 1.1.0 = "$.index[*][?(@.docs=='1.1.0')].id"
82
// @set 2.1.0 = "$.index[*][?(@.docs=='2.1.0')].id"
93
// @set 2.1.1 = "$.index[*][?(@.docs=='2.1.1')].id"

tests/rustdoc-json/enums/use_glob.rs

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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"

0 commit comments

Comments
 (0)