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.
This commit is contained in:
Alona Enraght-Moony 2023-11-07 16:36:55 +00:00
parent 187d1afa9d
commit f784fa7bd9
40 changed files with 9 additions and 126 deletions

View file

@ -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;

View file

@ -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,

View file

@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]
// @set AlwaysNone = "$.index[*][?(@.name == 'AlwaysNone')].id"
pub enum AlwaysNone {
// @set None = "$.index[*][?(@.name == 'None')].id"

View file

@ -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\"

View file

@ -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);

View file

@ -1,8 +1,5 @@
// ignore-tidy-linelength
#![feature(no_core)]
#![no_core]
// @set foo = "$.index[*][?(@.name=='Foo')].id"
pub trait Foo {}

View file

@ -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"

View file

@ -1,8 +1,5 @@
// ignore-tidy-linelength
#![feature(no_core)]
#![no_core]
// @set wham_id = "$.index[*][?(@.name=='Wham')].id"
pub trait Wham {}

View file

@ -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() {}
}

View file

@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]
pub struct Foo;
/// impl Foo priv
@ -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"'

View file

@ -1,6 +1,4 @@
// compile-flags: --document-hidden-items
#![feature(no_core)]
#![no_core]
pub struct Foo;
@ -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"'

View file

@ -1,6 +1,4 @@
// compile-flags: --document-private-items
#![feature(no_core)]
#![no_core]
pub struct Foo;
@ -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"'

View file

@ -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')]"

View file

@ -1,6 +1,4 @@
#![feature(no_core)]
#![feature(rustc_attrs)]
#![no_core]
// @set Local = "$.index[*][?(@.name=='Local')].id"
pub trait Local {}

View file

@ -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": []}}'
@ -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
}
}

View file

@ -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\"

View file

@ -1,8 +1,6 @@
// ignore-tidy-linelength
#![feature(abi_vectorcall)]
#![feature(no_core)]
#![no_core]
// @has "$.index[*][?(@.name=='Foo')]"
pub struct Foo;

View file

@ -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 {}

View file

@ -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

View file

@ -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

View file

@ -1,8 +1,5 @@
// edition:2018
#![no_core]
#![feature(no_core)]
// @is "$.index[*][?(@.name=='mod1')].inner.module.is_stripped" "true"
mod mod1 {
extern "C" {

View file

@ -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"

View file

@ -1,6 +1,3 @@
#![feature(no_core)]
#![no_core]
// @!has "$.index[*][?(@.name=='foo')]"
mod foo {
// @has "$.index[*][?(@.name=='Foo')]"

View file

@ -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

View file

@ -1,8 +1,5 @@
// edition:2018
#![no_core]
#![feature(no_core)]
// @set repro_id = "$.index[*][?(@.name=='repro')].id"
#[macro_export]
macro_rules! repro {

View file

@ -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() {}
}

View file

@ -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

View file

@ -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"

View file

@ -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 {}

View file

@ -1,8 +1,5 @@
// edition:2018
#![no_core]
#![feature(no_core)]
// @!has "$.index[*][?(@.name=='inner')]"
mod inner {
// @has "$.index[*][?(@.name=='Public')]"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -1,6 +1,4 @@
// edition:2018
#![no_core]
#![feature(no_core)]
// @!has "$.index[*][?(@.name=='inner')]"
mod inner {

View file

@ -1,8 +1,5 @@
// edition:2018
#![no_core]
#![feature(no_core)]
// @set inner_id = "$.index[*][?(@.name=='inner')].id"
pub mod inner {

View file

@ -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;
}

View file

@ -1,6 +1,3 @@
#![no_core]
#![feature(no_core)]
// @!has "$.index[*][?(@.name=='no_pub_inner')]"
mod no_pub_inner {
fn priv_inner() {}

View file

@ -1,9 +1,5 @@
// ignore-tidy-linelength
#![feature(no_core)]
#![no_core]
// @!has "$.index[*][?(@.name == 'sealed')]"
mod sealed {
// @set sealed_id = "$.index[*][?(@.name=='Sealed')].id"

View file

@ -1,8 +1,6 @@
// ignore-tidy-linelength
#![feature(no_core)]
#![feature(lang_items)]
#![no_core]
// @set loud_id = "$.index[*][?(@.name=='Loud')].id"
pub trait Loud {}

View file

@ -1,8 +1,6 @@
// ignore-tidy-linelength
#![feature(inherent_associated_types)]
#![feature(no_core)]
#![allow(incomplete_features)]
#![no_core]
// @set OwnerMetadata = '$.index[*][?(@.name=="OwnerMetadata")].id'
pub struct OwnerMetadata;