summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-json
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:42 +0000
commitcec1877e180393eba0f6ddb0cf97bf3a791631c7 (patch)
tree47b4dac2a9dd9a40c30c251b4d4a72d7ccf77e9f /tests/rustdoc-json
parentAdding debian version 1.74.1+dfsg1-1. (diff)
downloadrustc-cec1877e180393eba0f6ddb0cf97bf3a791631c7.tar.xz
rustc-cec1877e180393eba0f6ddb0cf97bf3a791631c7.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json')
-rw-r--r--tests/rustdoc-json/doc_hidden_failure.rs3
-rw-r--r--tests/rustdoc-json/enums/field_hidden.rs3
-rw-r--r--tests/rustdoc-json/enums/kind.rs3
-rw-r--r--tests/rustdoc-json/enums/tuple_fields_hidden.rs3
-rw-r--r--tests/rustdoc-json/enums/use_glob.rs3
-rw-r--r--tests/rustdoc-json/enums/use_variant.rs3
-rw-r--r--tests/rustdoc-json/fn_pointer/generics.rs3
-rw-r--r--tests/rustdoc-json/fns/extern_c_variadic.rs3
-rw-r--r--tests/rustdoc-json/fns/generic_args.rs3
-rw-r--r--tests/rustdoc-json/fns/generic_returns.rs3
-rw-r--r--tests/rustdoc-json/fns/generics.rs3
-rw-r--r--tests/rustdoc-json/generic-associated-types/gats.rs6
-rw-r--r--tests/rustdoc-json/glob_import.rs3
-rw-r--r--tests/rustdoc-json/impls/auto.rs9
-rw-r--r--tests/rustdoc-json/impls/impl_item_visibility.rs7
-rw-r--r--tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs6
-rw-r--r--tests/rustdoc-json/impls/impl_item_visibility_show_private.rs6
-rw-r--r--tests/rustdoc-json/impls/import_from_private.rs14
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs8
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs3
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs12
-rw-r--r--tests/rustdoc-json/impls/local_for_local.rs5
-rw-r--r--tests/rustdoc-json/impls/local_for_local_primitive.rs2
-rw-r--r--tests/rustdoc-json/lifetime/longest.rs9
-rw-r--r--tests/rustdoc-json/lifetime/outlives.rs3
-rw-r--r--tests/rustdoc-json/methods/abi.rs2
-rw-r--r--tests/rustdoc-json/non_lifetime_binders.rs11
-rw-r--r--tests/rustdoc-json/primitives/primitive_overloading.rs6
-rw-r--r--tests/rustdoc-json/reexport/export_extern_crate_as_self.rs3
-rw-r--r--tests/rustdoc-json/reexport/glob_collision.rs3
-rw-r--r--tests/rustdoc-json/reexport/glob_extern.rs3
-rw-r--r--tests/rustdoc-json/reexport/glob_private.rs3
-rw-r--r--tests/rustdoc-json/reexport/in_root_and_mod.rs3
-rw-r--r--tests/rustdoc-json/reexport/in_root_and_mod_pub.rs3
-rw-r--r--tests/rustdoc-json/reexport/macro.rs3
-rw-r--r--tests/rustdoc-json/reexport/mod_not_included.rs3
-rw-r--r--tests/rustdoc-json/reexport/private_twice_one_inline.rs4
-rw-r--r--tests/rustdoc-json/reexport/private_two_names.rs3
-rw-r--r--tests/rustdoc-json/reexport/pub_use_doc_hidden.rs8
-rw-r--r--tests/rustdoc-json/reexport/reexport_of_hidden.rs10
-rw-r--r--tests/rustdoc-json/reexport/rename_private.rs3
-rw-r--r--tests/rustdoc-json/reexport/rename_public.rs3
-rw-r--r--tests/rustdoc-json/reexport/same_name_different_types.rs3
-rw-r--r--tests/rustdoc-json/reexport/same_type_reexported_more_than_once.rs2
-rw-r--r--tests/rustdoc-json/reexport/simple_private.rs2
-rw-r--r--tests/rustdoc-json/reexport/simple_public.rs3
-rw-r--r--tests/rustdoc-json/return_private.rs3
-rw-r--r--tests/rustdoc-json/stripped_modules.rs3
-rw-r--r--tests/rustdoc-json/traits/implementors.rs29
-rw-r--r--tests/rustdoc-json/traits/private_supertrait.rs4
-rw-r--r--tests/rustdoc-json/traits/supertrait.rs4
-rw-r--r--tests/rustdoc-json/type/inherent_associated_type.rs2
-rw-r--r--tests/rustdoc-json/type/inherent_associated_type_bound.rs2
53 files changed, 61 insertions, 196 deletions
diff --git a/tests/rustdoc-json/doc_hidden_failure.rs b/tests/rustdoc-json/doc_hidden_failure.rs
index 0d2c6b220..e2ce66c99 100644
--- a/tests/rustdoc-json/doc_hidden_failure.rs
+++ b/tests/rustdoc-json/doc_hidden_failure.rs
@@ -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;
diff --git a/tests/rustdoc-json/enums/field_hidden.rs b/tests/rustdoc-json/enums/field_hidden.rs
index 5c0d0ffd3..74d96248d 100644
--- a/tests/rustdoc-json/enums/field_hidden.rs
+++ b/tests/rustdoc-json/enums/field_hidden.rs
@@ -1,8 +1,5 @@
// Regression test for <https://github.com/rust-lang/rust/issues/100529>.
-#![no_core]
-#![feature(no_core)]
-
// @has "$.index[*][?(@.name=='ParseError')]"
// @has "$.index[*][?(@.name=='UnexpectedEndTag')]"
// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant.kind.tuple" [null]
diff --git a/tests/rustdoc-json/enums/kind.rs b/tests/rustdoc-json/enums/kind.rs
index e283c0740..684836834 100644
--- a/tests/rustdoc-json/enums/kind.rs
+++ b/tests/rustdoc-json/enums/kind.rs
@@ -1,8 +1,5 @@
// ignore-tidy-linelength
-#![feature(no_core)]
-#![no_core]
-
pub enum Foo {
// @set Unit = "$.index[*][?(@.name=='Unit')].id"
// @is "$.index[*][?(@.name=='Unit')].inner.variant.kind" '"plain"'
diff --git a/tests/rustdoc-json/enums/tuple_fields_hidden.rs b/tests/rustdoc-json/enums/tuple_fields_hidden.rs
index 3aeb03564..53cdf83ff 100644
--- a/tests/rustdoc-json/enums/tuple_fields_hidden.rs
+++ b/tests/rustdoc-json/enums/tuple_fields_hidden.rs
@@ -1,6 +1,3 @@
-#![feature(no_core)]
-#![no_core]
-
// @set 1.1.0 = "$.index[*][?(@.docs=='1.1.0')].id"
// @set 2.1.0 = "$.index[*][?(@.docs=='2.1.0')].id"
// @set 2.1.1 = "$.index[*][?(@.docs=='2.1.1')].id"
diff --git a/tests/rustdoc-json/enums/use_glob.rs b/tests/rustdoc-json/enums/use_glob.rs
index 49990ec53..bec89530b 100644
--- a/tests/rustdoc-json/enums/use_glob.rs
+++ b/tests/rustdoc-json/enums/use_glob.rs
@@ -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,
diff --git a/tests/rustdoc-json/enums/use_variant.rs b/tests/rustdoc-json/enums/use_variant.rs
index 8190e1cbe..c7e0c21f1 100644
--- a/tests/rustdoc-json/enums/use_variant.rs
+++ b/tests/rustdoc-json/enums/use_variant.rs
@@ -1,6 +1,3 @@
-#![feature(no_core)]
-#![no_core]
-
// @set AlwaysNone = "$.index[*][?(@.name == 'AlwaysNone')].id"
pub enum AlwaysNone {
// @set None = "$.index[*][?(@.name == 'None')].id"
diff --git a/tests/rustdoc-json/fn_pointer/generics.rs b/tests/rustdoc-json/fn_pointer/generics.rs
index 3b82561ec..8b3a8c0a7 100644
--- a/tests/rustdoc-json/fn_pointer/generics.rs
+++ b/tests/rustdoc-json/fn_pointer/generics.rs
@@ -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\"
diff --git a/tests/rustdoc-json/fns/extern_c_variadic.rs b/tests/rustdoc-json/fns/extern_c_variadic.rs
index d6ea343b9..eef9ae99e 100644
--- a/tests/rustdoc-json/fns/extern_c_variadic.rs
+++ b/tests/rustdoc-json/fns/extern_c_variadic.rs
@@ -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);
diff --git a/tests/rustdoc-json/fns/generic_args.rs b/tests/rustdoc-json/fns/generic_args.rs
index 539d17f83..2f6cf3bf6 100644
--- a/tests/rustdoc-json/fns/generic_args.rs
+++ b/tests/rustdoc-json/fns/generic_args.rs
@@ -1,8 +1,5 @@
// ignore-tidy-linelength
-#![feature(no_core)]
-#![no_core]
-
// @set foo = "$.index[*][?(@.name=='Foo')].id"
pub trait Foo {}
diff --git a/tests/rustdoc-json/fns/generic_returns.rs b/tests/rustdoc-json/fns/generic_returns.rs
index 27d842066..8e82efef4 100644
--- a/tests/rustdoc-json/fns/generic_returns.rs
+++ b/tests/rustdoc-json/fns/generic_returns.rs
@@ -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"
diff --git a/tests/rustdoc-json/fns/generics.rs b/tests/rustdoc-json/fns/generics.rs
index 5239a6f21..44dc6d854 100644
--- a/tests/rustdoc-json/fns/generics.rs
+++ b/tests/rustdoc-json/fns/generics.rs
@@ -1,8 +1,5 @@
// ignore-tidy-linelength
-#![feature(no_core)]
-#![no_core]
-
// @set wham_id = "$.index[*][?(@.name=='Wham')].id"
pub trait Wham {}
diff --git a/tests/rustdoc-json/generic-associated-types/gats.rs b/tests/rustdoc-json/generic-associated-types/gats.rs
index 99c57ff65..56d6e7a49 100644
--- a/tests/rustdoc-json/generic-associated-types/gats.rs
+++ b/tests/rustdoc-json/generic-associated-types/gats.rs
@@ -1,11 +1,5 @@
// ignore-tidy-linelength
-#![no_core]
-#![feature(lang_items, no_core)]
-
-#[lang = "sized"]
-pub trait Sized {}
-
pub trait Display {}
pub trait LendingIterator {
diff --git a/tests/rustdoc-json/glob_import.rs b/tests/rustdoc-json/glob_import.rs
index f37ce0abb..7de1ed78f 100644
--- a/tests/rustdoc-json/glob_import.rs
+++ b/tests/rustdoc-json/glob_import.rs
@@ -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() {}
}
diff --git a/tests/rustdoc-json/impls/auto.rs b/tests/rustdoc-json/impls/auto.rs
index ace37e5b3..96c3ab08b 100644
--- a/tests/rustdoc-json/impls/auto.rs
+++ b/tests/rustdoc-json/impls/auto.rs
@@ -1,9 +1,12 @@
-#![feature(no_core, auto_traits, lang_items)]
+#![feature(no_core, auto_traits, lang_items, arbitrary_self_types)]
#![no_core]
#[lang = "sized"]
trait Sized {}
+#[lang = "receiver"]
+pub trait Receiver {}
+
pub auto trait Bar {}
/// has span
@@ -12,8 +15,8 @@ impl Foo {
}
// Testing spans, so all tests below code
-// @is "$.index[*][?(@.docs=='has span')].span.begin" "[10, 0]"
-// @is "$.index[*][?(@.docs=='has span')].span.end" "[12, 1]"
+// @is "$.index[*][?(@.docs=='has span')].span.begin" "[13, 0]"
+// @is "$.index[*][?(@.docs=='has span')].span.end" "[15, 1]"
// FIXME: this doesn't work due to https://github.com/freestrings/jsonpath/issues/91
// is "$.index[*][?(@.inner.impl.synthetic==true)].span" null
pub struct Foo;
diff --git a/tests/rustdoc-json/impls/impl_item_visibility.rs b/tests/rustdoc-json/impls/impl_item_visibility.rs
index efa54d91d..d3c15cd23 100644
--- a/tests/rustdoc-json/impls/impl_item_visibility.rs
+++ b/tests/rustdoc-json/impls/impl_item_visibility.rs
@@ -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"'
diff --git a/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs b/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
index 3c6fefc4c..fa3a36df8 100644
--- a/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
+++ b/tests/rustdoc-json/impls/impl_item_visibility_show_hidden.rs
@@ -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"'
diff --git a/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs b/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs
index b98d1e416..7c68a2412 100644
--- a/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs
+++ b/tests/rustdoc-json/impls/impl_item_visibility_show_private.rs
@@ -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"'
diff --git a/tests/rustdoc-json/impls/import_from_private.rs b/tests/rustdoc-json/impls/import_from_private.rs
index d2b0665dc..3da03df25 100644
--- a/tests/rustdoc-json/impls/import_from_private.rs
+++ b/tests/rustdoc-json/impls/import_from_private.rs
@@ -1,14 +1,12 @@
// https://github.com/rust-lang/rust/issues/100252
-#![feature(no_core)]
-#![no_core]
-
mod bar {
- // @set baz = "$.index[*][?(@.inner.struct)].id"
+ // @set baz = "$.index[*][?(@.name == 'Baz')].id"
pub struct Baz;
- // @set impl = "$.index[*][?(@.inner.impl)].id"
+ // @set impl = "$.index[*][?(@.docs == 'impl')].id"
+ /// impl
impl Baz {
- // @set doit = "$.index[*][?(@.inner.function)].id"
+ // @set doit = "$.index[*][?(@.name == 'doit')].id"
pub fn doit() {}
}
}
@@ -18,5 +16,5 @@ pub use bar::Baz;
// @is "$.index[*].inner.module.items[*]" $import
// @is "$.index[*].inner.import.id" $baz
-// @is "$.index[*].inner.struct.impls[*]" $impl
-// @is "$.index[*].inner.impl.items[*]" $doit
+// @has "$.index[*][?(@.name == 'Baz')].inner.struct.impls[*]" $impl
+// @is "$.index[*][?(@.docs=='impl')].inner.impl.items[*]" $doit
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
index d2ac316d4..7857626d6 100644
--- a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
@@ -1,7 +1,5 @@
-#![feature(no_core)]
-#![no_core]
-
-// @count "$.index[*][?(@.inner.impl)]" 1
+// @has "$.index[*][?(@.docs=='Here')]"
+// @!has "$.index[*][?(@.docs=='Not Here')]"
// @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
// @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
// @has "$.index[*][?(@.name=='PubTrait')]"
@@ -11,5 +9,7 @@ pub trait PubTrait {}
pub struct HiddenPubStruct;
pub struct NotHiddenPubStruct;
+/// Not Here
impl PubTrait for HiddenPubStruct {}
+/// Here
impl PubTrait for NotHiddenPubStruct {}
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
index fcd27ca4b..836f1fe87 100644
--- a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
@@ -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')]"
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
index 141c54a57..97db9c93a 100644
--- a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
@@ -1,21 +1,21 @@
-#![feature(no_core)]
-#![no_core]
-
-// @count "$.index[*][?(@.inner.impl)]" 1
-// @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
-// @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
// @has "$.index[*][?(@.name=='PubTrait')]"
pub trait PubTrait {}
#[doc(hidden)]
pub mod hidden {
+ // @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
pub struct HiddenPubStruct;
+ // @!has "$.index[*][?(@.docs == 'Not Here')]"
+ /// Not Here
impl crate::PubTrait for HiddenPubStruct {}
}
pub mod not_hidden {
+ // @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
pub struct NotHiddenPubStruct;
+ // @has "$.index[*][?(@.docs == 'Here')]"
+ /// Here
impl crate::PubTrait for NotHiddenPubStruct {}
}
diff --git a/tests/rustdoc-json/impls/local_for_local.rs b/tests/rustdoc-json/impls/local_for_local.rs
index 37a720003..015e89c22 100644
--- a/tests/rustdoc-json/impls/local_for_local.rs
+++ b/tests/rustdoc-json/impls/local_for_local.rs
@@ -1,6 +1,3 @@
-#![feature(no_core)]
-#![no_core]
-
// @set struct = "$.index[*][?(@.name=='Struct')].id"
pub struct Struct;
// @set trait = "$.index[*][?(@.name=='Trait')].id"
@@ -9,7 +6,7 @@ pub trait Trait {}
/// impl
impl Trait for Struct {}
-// @is "$.index[*][?(@.name=='Struct')].inner.struct.impls[*]" $impl
+// @has "$.index[*][?(@.name=='Struct')].inner.struct.impls[*]" $impl
// @is "$.index[*][?(@.name=='Trait')].inner.trait.implementations[*]" $impl
// @is "$.index[*][?(@.docs=='impl')].inner.impl.trait.id" $trait
// @is "$.index[*][?(@.docs=='impl')].inner.impl.for.resolved_path.id" $struct
diff --git a/tests/rustdoc-json/impls/local_for_local_primitive.rs b/tests/rustdoc-json/impls/local_for_local_primitive.rs
index 769dd3f0a..acc3a879f 100644
--- a/tests/rustdoc-json/impls/local_for_local_primitive.rs
+++ b/tests/rustdoc-json/impls/local_for_local_primitive.rs
@@ -1,6 +1,4 @@
-#![feature(no_core)]
#![feature(rustc_attrs)]
-#![no_core]
// @set Local = "$.index[*][?(@.name=='Local')].id"
pub trait Local {}
diff --git a/tests/rustdoc-json/lifetime/longest.rs b/tests/rustdoc-json/lifetime/longest.rs
index dc28258a8..419b0b4fc 100644
--- a/tests/rustdoc-json/lifetime/longest.rs
+++ b/tests/rustdoc-json/lifetime/longest.rs
@@ -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
+ }
}
diff --git a/tests/rustdoc-json/lifetime/outlives.rs b/tests/rustdoc-json/lifetime/outlives.rs
index 6e105b382..549e4c200 100644
--- a/tests/rustdoc-json/lifetime/outlives.rs
+++ b/tests/rustdoc-json/lifetime/outlives.rs
@@ -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\"
diff --git a/tests/rustdoc-json/methods/abi.rs b/tests/rustdoc-json/methods/abi.rs
index b8279298c..917e9e079 100644
--- a/tests/rustdoc-json/methods/abi.rs
+++ b/tests/rustdoc-json/methods/abi.rs
@@ -1,8 +1,6 @@
// ignore-tidy-linelength
#![feature(abi_vectorcall)]
-#![feature(no_core)]
-#![no_core]
// @has "$.index[*][?(@.name=='Foo')]"
pub struct Foo;
diff --git a/tests/rustdoc-json/non_lifetime_binders.rs b/tests/rustdoc-json/non_lifetime_binders.rs
index cabee0b1c..d925fcd52 100644
--- a/tests/rustdoc-json/non_lifetime_binders.rs
+++ b/tests/rustdoc-json/non_lifetime_binders.rs
@@ -3,18 +3,9 @@
#![feature(non_lifetime_binders)]
#![allow(incomplete_features)]
-#![no_core]
-#![feature(lang_items, no_core)]
-
-#[lang = "sized"]
-pub trait Sized {}
-
pub trait Trait {}
-#[lang = "phantom_data"]
-struct PhantomData<T_>;
-
-pub struct Wrapper<T_>(PhantomData<T_>);
+pub struct Wrapper<T_>(std::marker::PhantomData<T_>);
// @count "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates[0].bound_predicate.generic_params[*]" 2
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates[0].bound_predicate.generic_params[0].name" \"\'a\"
diff --git a/tests/rustdoc-json/primitives/primitive_overloading.rs b/tests/rustdoc-json/primitives/primitive_overloading.rs
index 81e0acdc6..50e23fc06 100644
--- a/tests/rustdoc-json/primitives/primitive_overloading.rs
+++ b/tests/rustdoc-json/primitives/primitive_overloading.rs
@@ -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 {}
diff --git a/tests/rustdoc-json/reexport/export_extern_crate_as_self.rs b/tests/rustdoc-json/reexport/export_extern_crate_as_self.rs
index 37ca279b3..a8f5500d6 100644
--- a/tests/rustdoc-json/reexport/export_extern_crate_as_self.rs
+++ b/tests/rustdoc-json/reexport/export_extern_crate_as_self.rs
@@ -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
diff --git a/tests/rustdoc-json/reexport/glob_collision.rs b/tests/rustdoc-json/reexport/glob_collision.rs
index dee35ba78..9a75f4c0c 100644
--- a/tests/rustdoc-json/reexport/glob_collision.rs
+++ b/tests/rustdoc-json/reexport/glob_collision.rs
@@ -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
diff --git a/tests/rustdoc-json/reexport/glob_extern.rs b/tests/rustdoc-json/reexport/glob_extern.rs
index 78edfaf0a..ed0c4a420 100644
--- a/tests/rustdoc-json/reexport/glob_extern.rs
+++ b/tests/rustdoc-json/reexport/glob_extern.rs
@@ -1,8 +1,5 @@
// edition:2018
-#![no_core]
-#![feature(no_core)]
-
// @is "$.index[*][?(@.name=='mod1')].inner.module.is_stripped" "true"
mod mod1 {
extern "C" {
diff --git a/tests/rustdoc-json/reexport/glob_private.rs b/tests/rustdoc-json/reexport/glob_private.rs
index ae4e87d23..11ea5aa35 100644
--- a/tests/rustdoc-json/reexport/glob_private.rs
+++ b/tests/rustdoc-json/reexport/glob_private.rs
@@ -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"
diff --git a/tests/rustdoc-json/reexport/in_root_and_mod.rs b/tests/rustdoc-json/reexport/in_root_and_mod.rs
index f81445bd4..a4133e2f0 100644
--- a/tests/rustdoc-json/reexport/in_root_and_mod.rs
+++ b/tests/rustdoc-json/reexport/in_root_and_mod.rs
@@ -1,6 +1,3 @@
-#![feature(no_core)]
-#![no_core]
-
// @!has "$.index[*][?(@.name=='foo')]"
mod foo {
// @has "$.index[*][?(@.name=='Foo')]"
diff --git a/tests/rustdoc-json/reexport/in_root_and_mod_pub.rs b/tests/rustdoc-json/reexport/in_root_and_mod_pub.rs
index c5c41b25f..37f7b26fc 100644
--- a/tests/rustdoc-json/reexport/in_root_and_mod_pub.rs
+++ b/tests/rustdoc-json/reexport/in_root_and_mod_pub.rs
@@ -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
diff --git a/tests/rustdoc-json/reexport/macro.rs b/tests/rustdoc-json/reexport/macro.rs
index ac0632b98..be09cb476 100644
--- a/tests/rustdoc-json/reexport/macro.rs
+++ b/tests/rustdoc-json/reexport/macro.rs
@@ -1,8 +1,5 @@
// edition:2018
-#![no_core]
-#![feature(no_core)]
-
// @set repro_id = "$.index[*][?(@.name=='repro')].id"
#[macro_export]
macro_rules! repro {
diff --git a/tests/rustdoc-json/reexport/mod_not_included.rs b/tests/rustdoc-json/reexport/mod_not_included.rs
index 1c49f213d..bc072be81 100644
--- a/tests/rustdoc-json/reexport/mod_not_included.rs
+++ b/tests/rustdoc-json/reexport/mod_not_included.rs
@@ -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() {}
}
diff --git a/tests/rustdoc-json/reexport/private_twice_one_inline.rs b/tests/rustdoc-json/reexport/private_twice_one_inline.rs
index 8c8152bd1..d7b766235 100644
--- a/tests/rustdoc-json/reexport/private_twice_one_inline.rs
+++ b/tests/rustdoc-json/reexport/private_twice_one_inline.rs
@@ -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
diff --git a/tests/rustdoc-json/reexport/private_two_names.rs b/tests/rustdoc-json/reexport/private_two_names.rs
index cdcbf2a2b..e6f037eb4 100644
--- a/tests/rustdoc-json/reexport/private_two_names.rs
+++ b/tests/rustdoc-json/reexport/private_two_names.rs
@@ -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"
diff --git a/tests/rustdoc-json/reexport/pub_use_doc_hidden.rs b/tests/rustdoc-json/reexport/pub_use_doc_hidden.rs
index a2a25d084..15d194ef5 100644
--- a/tests/rustdoc-json/reexport/pub_use_doc_hidden.rs
+++ b/tests/rustdoc-json/reexport/pub_use_doc_hidden.rs
@@ -1,15 +1,13 @@
// Regression test for <https://github.com/rust-lang/rust/issues/106379>
-#![feature(no_core)]
-#![no_core]
-
mod repeat_n {
#[doc(hidden)]
+ /// not here
pub struct RepeatN {}
}
+/// not here
pub use repeat_n::RepeatN;
// @count "$.index[*][?(@.name=='pub_use_doc_hidden')].inner.items[*]" 0
-// @!has "$.index[*][?(@.kind=='struct')]"
-// @!has "$.index[*][?(@.kind=='import')]"
+// @!has "$.index[*][?(@.docs == 'not here')]"
diff --git a/tests/rustdoc-json/reexport/reexport_of_hidden.rs b/tests/rustdoc-json/reexport/reexport_of_hidden.rs
new file mode 100644
index 000000000..1b6ff5fad
--- /dev/null
+++ b/tests/rustdoc-json/reexport/reexport_of_hidden.rs
@@ -0,0 +1,10 @@
+// compile-flags: --document-hidden-items
+
+// @has "$.index[*].inner[?(@.import.name=='UsedHidden')]"
+// @has "$.index[*][?(@.name=='Hidden')]"
+pub mod submodule {
+ #[doc(hidden)]
+ pub struct Hidden {}
+}
+
+pub use submodule::Hidden as UsedHidden;
diff --git a/tests/rustdoc-json/reexport/rename_private.rs b/tests/rustdoc-json/reexport/rename_private.rs
index 911446023..3924282a4 100644
--- a/tests/rustdoc-json/reexport/rename_private.rs
+++ b/tests/rustdoc-json/reexport/rename_private.rs
@@ -1,8 +1,5 @@
// edition:2018
-#![no_core]
-#![feature(no_core)]
-
// @!has "$.index[*][?(@.name=='inner')]"
mod inner {
// @has "$.index[*][?(@.name=='Public')]"
diff --git a/tests/rustdoc-json/reexport/rename_public.rs b/tests/rustdoc-json/reexport/rename_public.rs
index d0fd314bd..636937874 100644
--- a/tests/rustdoc-json/reexport/rename_public.rs
+++ b/tests/rustdoc-json/reexport/rename_public.rs
@@ -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"
diff --git a/tests/rustdoc-json/reexport/same_name_different_types.rs b/tests/rustdoc-json/reexport/same_name_different_types.rs
index 6a765b733..42ba6c400 100644
--- a/tests/rustdoc-json/reexport/same_name_different_types.rs
+++ b/tests/rustdoc-json/reexport/same_name_different_types.rs
@@ -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"
diff --git a/tests/rustdoc-json/reexport/same_type_reexported_more_than_once.rs b/tests/rustdoc-json/reexport/same_type_reexported_more_than_once.rs
index a00547dc3..1e1710e1c 100644
--- a/tests/rustdoc-json/reexport/same_type_reexported_more_than_once.rs
+++ b/tests/rustdoc-json/reexport/same_type_reexported_more_than_once.rs
@@ -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"
diff --git a/tests/rustdoc-json/reexport/simple_private.rs b/tests/rustdoc-json/reexport/simple_private.rs
index 462efee51..2ca8c7fa6 100644
--- a/tests/rustdoc-json/reexport/simple_private.rs
+++ b/tests/rustdoc-json/reexport/simple_private.rs
@@ -1,6 +1,4 @@
// edition:2018
-#![no_core]
-#![feature(no_core)]
// @!has "$.index[*][?(@.name=='inner')]"
mod inner {
diff --git a/tests/rustdoc-json/reexport/simple_public.rs b/tests/rustdoc-json/reexport/simple_public.rs
index 1373f96f8..04611eeb9 100644
--- a/tests/rustdoc-json/reexport/simple_public.rs
+++ b/tests/rustdoc-json/reexport/simple_public.rs
@@ -1,8 +1,5 @@
// edition:2018
-#![no_core]
-#![feature(no_core)]
-
// @set inner_id = "$.index[*][?(@.name=='inner')].id"
pub mod inner {
diff --git a/tests/rustdoc-json/return_private.rs b/tests/rustdoc-json/return_private.rs
index 0ce81b5e5..a9301b3fe 100644
--- a/tests/rustdoc-json/return_private.rs
+++ b/tests/rustdoc-json/return_private.rs
@@ -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;
}
diff --git a/tests/rustdoc-json/stripped_modules.rs b/tests/rustdoc-json/stripped_modules.rs
index d2664b49e..d5ab1173d 100644
--- a/tests/rustdoc-json/stripped_modules.rs
+++ b/tests/rustdoc-json/stripped_modules.rs
@@ -1,6 +1,3 @@
-#![no_core]
-#![feature(no_core)]
-
// @!has "$.index[*][?(@.name=='no_pub_inner')]"
mod no_pub_inner {
fn priv_inner() {}
diff --git a/tests/rustdoc-json/traits/implementors.rs b/tests/rustdoc-json/traits/implementors.rs
index 7d351ad61..c27553c75 100644
--- a/tests/rustdoc-json/traits/implementors.rs
+++ b/tests/rustdoc-json/traits/implementors.rs
@@ -1,19 +1,18 @@
-#![feature(no_core)]
-#![no_core]
-
-// @set wham = "$.index[*][?(@.name=='Wham')].id"
-// @count "$.index[*][?(@.name=='Wham')].inner.trait.implementations[*]" 1
-// @set gmWham = "$.index[*][?(@.name=='Wham')].inner.trait.implementations[0]"
pub trait Wham {}
-
-// @count "$.index[*][?(@.name=='GeorgeMichael')].inner.struct.impls[*]" 1
-// @is "$.index[*][?(@.name=='GeorgeMichael')].inner.struct.impls[0]" $gmWham
-// @set gm = "$.index[*][?(@.name=='Wham')].id"
-
-// jsonpath_lib isnt expressive enough (for now) to get the "impl" item, so we
-// just check it isn't pointing to the type, but when you port to jsondocck-ng
-// check what the impl item is
-// @!is "$.index[*][?(@.name=='Wham')].inner.trait.implementations[0]" $gm
pub struct GeorgeMichael {}
+/// Wham for George Michael
impl Wham for GeorgeMichael {}
+
+// Find IDs.
+// @set wham = "$.index[*][?(@.name=='Wham')].id"
+// @set gmWham = "$.index[*][?(@.docs=='Wham for George Michael')].id"
+// @set gm = "$.index[*][?(@.name=='GeorgeMichael')].id"
+
+// Both struct and trait point to impl.
+// @has "$.index[*][?(@.name=='GeorgeMichael')].inner.struct.impls[*]" $gmWham
+// @is "$.index[*][?(@.name=='Wham')].inner.trait.implementations[*]" $gmWham
+
+// Impl points to both struct and trait.
+// @is "$.index[*][?(@.docs == 'Wham for George Michael')].inner.impl.trait.id" $wham
+// @is "$.index[*][?(@.docs == 'Wham for George Michael')].inner.impl.for.resolved_path.id" $gm
diff --git a/tests/rustdoc-json/traits/private_supertrait.rs b/tests/rustdoc-json/traits/private_supertrait.rs
index 49238e5e8..67b5a858a 100644
--- a/tests/rustdoc-json/traits/private_supertrait.rs
+++ b/tests/rustdoc-json/traits/private_supertrait.rs
@@ -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"
diff --git a/tests/rustdoc-json/traits/supertrait.rs b/tests/rustdoc-json/traits/supertrait.rs
index 2123ac404..bbae3557c 100644
--- a/tests/rustdoc-json/traits/supertrait.rs
+++ b/tests/rustdoc-json/traits/supertrait.rs
@@ -1,9 +1,5 @@
// ignore-tidy-linelength
-#![feature(no_core)]
-#![feature(lang_items)]
-#![no_core]
-
// @set loud_id = "$.index[*][?(@.name=='Loud')].id"
pub trait Loud {}
diff --git a/tests/rustdoc-json/type/inherent_associated_type.rs b/tests/rustdoc-json/type/inherent_associated_type.rs
index 64c6c53ce..f86031479 100644
--- a/tests/rustdoc-json/type/inherent_associated_type.rs
+++ b/tests/rustdoc-json/type/inherent_associated_type.rs
@@ -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;
diff --git a/tests/rustdoc-json/type/inherent_associated_type_bound.rs b/tests/rustdoc-json/type/inherent_associated_type_bound.rs
index 8e39f4718..6da23c8fb 100644
--- a/tests/rustdoc-json/type/inherent_associated_type_bound.rs
+++ b/tests/rustdoc-json/type/inherent_associated_type_bound.rs
@@ -16,5 +16,5 @@ pub struct Carrier<'a>(&'a ());
pub fn user(_: for<'b> fn(Carrier<'b>::Focus<i32>)) {}
impl<'a> Carrier<'a> {
- pub type Focus<T> = &'a mut T;
+ pub type Focus<T> = &'a mut T where T: 'a;
}