Skip to content

Commit

Permalink
tests/rustdoc-json: Remove some needless uses of #![no_core].
Browse files Browse the repository at this point in the history
Done by removing all uses of `#![no_core]`, and the reverting the ones
that failed. More involved ones are in a later commit.
  • Loading branch information
aDotInTheVoid committed Nov 7, 2023
1 parent 187d1af commit f784fa7
Show file tree
Hide file tree
Showing 40 changed files with 9 additions and 126 deletions.
3 changes: 0 additions & 3 deletions tests/rustdoc-json/doc_hidden_failure.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Regression test for <https://github.com/rust-lang/rust/issues/98007>.

#![feature(no_core)]
#![no_core]

mod auto {
mod action_row {
pub struct ActionRowBuilder;
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/enums/use_glob.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Regression test for <https://github.com/rust-lang/rust/issues/104942>

#![feature(no_core)]
#![no_core]

// @set Color = "$.index[*][?(@.name == 'Color')].id"
pub enum Color {
Red,
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/enums/use_variant.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]

// @set AlwaysNone = "$.index[*][?(@.name == 'AlwaysNone')].id"
pub enum AlwaysNone {
// @set None = "$.index[*][?(@.name == 'None')].id"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/fn_pointer/generics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

// @count "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type_alias.type.function_pointer.decl.inputs[*]" 1
// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type_alias.type.function_pointer.decl.inputs[0][0]" '"val"'
// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type_alias.type.function_pointer.decl.inputs[0][1].borrowed_ref.lifetime" \"\'c\"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/fns/extern_c_variadic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]

extern "C" {
// @is "$.index[*][?(@.name == 'not_variadic')].inner.function.decl.c_variadic" false
pub fn not_variadic(_: i32);
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/fns/generic_args.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

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

Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/fns/generic_returns.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

// @count "$.index[*][?(@.name=='generic_returns')].inner.module.items[*]" 2

// @set foo = "$.index[*][?(@.name=='Foo')].id"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/fns/generics.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

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

Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/glob_import.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// This is a regression test for <https://github.com/rust-lang/rust/issues/98003>.

#![feature(no_core)]
#![no_std]
#![no_core]

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


mod m1 {
pub fn f() {}
}
Expand Down
7 changes: 1 addition & 6 deletions tests/rustdoc-json/impls/impl_item_visibility.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]

pub struct Foo;

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


/// impl Foo pub
impl Foo {
pub fn qux() {}
}
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'


/// impl Foo hidden
impl Foo {
#[doc(hidden)]
pub fn __quazl(){}
pub fn __quazl() {}
}
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
6 changes: 1 addition & 5 deletions tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// compile-flags: --document-hidden-items
#![feature(no_core)]
#![no_core]

pub struct Foo;

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


/// impl Foo pub
impl Foo {
pub fn qux() {}
}
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'


/// impl Foo hidden
impl Foo {
#[doc(hidden)]
pub fn __quazl(){}
pub fn __quazl() {}
}
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// compile-flags: --document-private-items
#![feature(no_core)]
#![no_core]

pub struct Foo;

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


/// impl Foo pub
impl Foo {
pub fn qux() {}
}
// @is '$.index[*][?(@.docs=="impl Foo pub")].visibility' '"default"'


/// impl Foo hidden
impl Foo {
#[doc(hidden)]
pub fn __quazl(){}
pub fn __quazl() {}
}
// FIXME(#111564): Is this the right behaviour?
// @is '$.index[*][?(@.docs=="impl Foo hidden")].visibility' '"default"'
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// compile-flags: --document-hidden-items

#![feature(no_core)]
#![no_core]

// @has "$.index[*][?(@.name == 'HiddenPubStruct')]"
// @has "$.index[*][?(@.inner.impl)]"
// @has "$.index[*][?(@.name=='PubTrait')]"
Expand Down
2 changes: 0 additions & 2 deletions tests/rustdoc-json/impls/local_for_local_primitive.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![feature(no_core)]
#![feature(rustc_attrs)]
#![no_core]

// @set Local = "$.index[*][?(@.name=='Local')].id"
pub trait Local {}
Expand Down
9 changes: 5 additions & 4 deletions tests/rustdoc-json/lifetime/longest.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

// @is "$.index[*][?(@.name=='longest')].inner.function.generics.params[0].name" \"\'a\"
// @is "$.index[*][?(@.name=='longest')].inner.function.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
// @is "$.index[*][?(@.name=='longest')].inner.function.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
Expand All @@ -26,5 +23,9 @@
// @is "$.index[*][?(@.name=='longest')].inner.function.decl.output.borrowed_ref.type.primitive" \"str\"

pub fn longest<'a>(l: &'a str, r: &'a str) -> &'a str {
if l.len() > r.len() { l } else { r }
if l.len() > r.len() {
l
} else {
r
}
}
3 changes: 0 additions & 3 deletions tests/rustdoc-json/lifetime/outlives.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

// @count "$.index[*][?(@.name=='foo')].inner.function.generics.params[*]" 3
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates" []
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.params[0].name" \"\'a\"
Expand Down
2 changes: 0 additions & 2 deletions tests/rustdoc-json/methods/abi.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// ignore-tidy-linelength

#![feature(abi_vectorcall)]
#![feature(no_core)]
#![no_core]

// @has "$.index[*][?(@.name=='Foo')]"
pub struct Foo;
Expand Down
6 changes: 1 addition & 5 deletions tests/rustdoc-json/primitives/primitive_overloading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
// Regression test for <https://github.com/rust-lang/rust/issues/98006>.

#![feature(rustc_attrs)]
#![feature(no_core)]

#![no_core]

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

#[rustc_doc_primitive = "usize"]
/// This is the built-in type `usize`.
mod prim {
}
mod prim {}
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/export_extern_crate_as_self.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/100531>
#![feature(no_core)]
#![no_core]

#![crate_name = "export_extern_crate_as_self"]

// ignore-tidy-linelength
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/glob_collision.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Regression test for https://github.com/rust-lang/rust/issues/100973

#![feature(no_core)]
#![no_core]

// @set m1 = "$.index[*][?(@.name == 'm1' && @.inner.module)].id"
// @is "$.index[*][?(@.name == 'm1')].inner.module.items" []
// @is "$.index[*][?(@.name == 'm1')].inner.module.is_stripped" true
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/glob_extern.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// edition:2018

#![no_core]
#![feature(no_core)]

// @is "$.index[*][?(@.name=='mod1')].inner.module.is_stripped" "true"
mod mod1 {
extern "C" {
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/glob_private.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// edition:2018

#![no_core]
#![feature(no_core)]

// @is "$.index[*][?(@.name=='mod1')].inner.module.is_stripped" "true"
mod mod1 {
// @is "$.index[*][?(@.name=='mod2')].inner.module.is_stripped" "true"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/in_root_and_mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]

// @!has "$.index[*][?(@.name=='foo')]"
mod foo {
// @has "$.index[*][?(@.name=='Foo')]"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/in_root_and_mod_pub.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]

pub mod foo {
// @set bar_id = "$.index[*][?(@.name=='Bar')].id"
// @ismany "$.index[*][?(@.name=='foo')].inner.module.items[*]" $bar_id
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/macro.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// edition:2018

#![no_core]
#![feature(no_core)]

// @set repro_id = "$.index[*][?(@.name=='repro')].id"
#[macro_export]
macro_rules! repro {
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/mod_not_included.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Regression test for https://github.com/rust-lang/rust/issues/101103

#![feature(no_core)]
#![no_core]

mod m1 {
pub fn x() {}
}
Expand Down
4 changes: 0 additions & 4 deletions tests/rustdoc-json/reexport/private_twice_one_inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
// Test for the ICE in https://github.com/rust-lang/rust/issues/83057
// An external type re-exported with different attributes shouldn't cause an error

#![no_core]
#![feature(no_core)]

extern crate pub_struct as foo;
#[doc(inline)]

// @set crate_use_id = "$.index[*][?(@.docs=='Hack A')].id"
// @set foo_id = "$.index[*][?(@.docs=='Hack A')].inner.import.id"
/// Hack A
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/private_two_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
// Test for the ICE in https://github.com/rust-lang/rust/issues/83720
// A pub-in-private type re-exported under two different names shouldn't cause an error

#![no_core]
#![feature(no_core)]

// @!has "$.index[*][?(@.name=='style')]"
mod style {
// @set color_struct_id = "$.index[*][?(@.inner.struct && @.name=='Color')].id"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/pub_use_doc_hidden.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Regression test for <https://github.com/rust-lang/rust/issues/106379>

#![feature(no_core)]
#![no_core]

mod repeat_n {
#[doc(hidden)]
pub struct RepeatN {}
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/rename_private.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// edition:2018

#![no_core]
#![feature(no_core)]

// @!has "$.index[*][?(@.name=='inner')]"
mod inner {
// @has "$.index[*][?(@.name=='Public')]"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/rename_public.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// edition:2018

#![no_core]
#![feature(no_core)]

// @set inner_id = "$.index[*][?(@.name=='inner')].id"
pub mod inner {
// @set public_id = "$.index[*][?(@.name=='Public')].id"
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/same_name_different_types.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Regression test for <https://github.com/rust-lang/rust/issues/107677>.

#![feature(no_core)]
#![no_core]

pub mod nested {
// @set foo_struct = "$.index[*][?(@.docs == 'Foo the struct')].id"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

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

#![feature(no_core)]
#![no_std]
#![no_core]

mod inner {
// @set trait_id = "$.index[*][?(@.name=='Trait')].id"
Expand Down
2 changes: 0 additions & 2 deletions tests/rustdoc-json/reexport/simple_private.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// edition:2018
#![no_core]
#![feature(no_core)]

// @!has "$.index[*][?(@.name=='inner')]"
mod inner {
Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/reexport/simple_public.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// edition:2018

#![no_core]
#![feature(no_core)]

// @set inner_id = "$.index[*][?(@.name=='inner')].id"
pub mod inner {

Expand Down
3 changes: 0 additions & 3 deletions tests/rustdoc-json/return_private.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Regression test for <https://github.com/rust-lang/rust/issues/96161>.
// ignore-tidy-linelength

#![feature(no_core)]
#![no_core]

mod secret {
pub struct Secret;
}
Expand Down
Loading

0 comments on commit f784fa7

Please sign in to comment.