summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-json
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/rustdoc-json
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json')
-rw-r--r--tests/rustdoc-json/fns/extern_c_variadic.rs9
-rw-r--r--tests/rustdoc-json/impls/local_for_local_primitive.rs4
-rw-r--r--tests/rustdoc-json/non_lifetime_binders.rs24
-rw-r--r--tests/rustdoc-json/primitives/local_primitive.rs2
-rw-r--r--tests/rustdoc-json/primitives/primitive_impls.rs2
-rw-r--r--tests/rustdoc-json/primitives/primitive_overloading.rs4
-rw-r--r--tests/rustdoc-json/primitives/use_primitive.rs4
7 files changed, 41 insertions, 8 deletions
diff --git a/tests/rustdoc-json/fns/extern_c_variadic.rs b/tests/rustdoc-json/fns/extern_c_variadic.rs
new file mode 100644
index 000000000..33bebbab5
--- /dev/null
+++ b/tests/rustdoc-json/fns/extern_c_variadic.rs
@@ -0,0 +1,9 @@
+#![feature(no_core)]
+#![no_core]
+
+extern "C" {
+ // @is "$.index[*][?(@.name == 'not_variadic')].inner.decl.c_variadic" false
+ pub fn not_variadic(_: i32);
+ // @is "$.index[*][?(@.name == 'variadic')].inner.decl.c_variadic" true
+ pub fn variadic(_: i32, ...);
+}
diff --git a/tests/rustdoc-json/impls/local_for_local_primitive.rs b/tests/rustdoc-json/impls/local_for_local_primitive.rs
index 38e7e2658..8383dcc04 100644
--- a/tests/rustdoc-json/impls/local_for_local_primitive.rs
+++ b/tests/rustdoc-json/impls/local_for_local_primitive.rs
@@ -1,5 +1,5 @@
#![feature(no_core)]
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![no_core]
// @set Local = "$.index[*][?(@.name=='Local')].id"
@@ -16,6 +16,6 @@ impl Local for bool {}
// FIXME(#101695): Test bool's `impls` include "Local for bool"
// @has "$.index[*][?(@.name=='bool')]"
-#[doc(primitive = "bool")]
+#[rustc_doc_primitive = "bool"]
/// Boolean docs
mod prim_bool {}
diff --git a/tests/rustdoc-json/non_lifetime_binders.rs b/tests/rustdoc-json/non_lifetime_binders.rs
new file mode 100644
index 000000000..ca5a00834
--- /dev/null
+++ b/tests/rustdoc-json/non_lifetime_binders.rs
@@ -0,0 +1,24 @@
+// ignore-tidy-linelength
+
+#![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_>);
+
+// @count "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[*]" 2
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[0].name" \"\'a\"
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[1].name" \"T\"
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates[0].bound_predicate.generic_params[1].kind" '{ "type": { "bounds": [], "default": null, "synthetic": false } }'
+pub fn foo() where for<'a, T> &'a Wrapper<T>: Trait {}
diff --git a/tests/rustdoc-json/primitives/local_primitive.rs b/tests/rustdoc-json/primitives/local_primitive.rs
index f27e6a2ad..0cf479faf 100644
--- a/tests/rustdoc-json/primitives/local_primitive.rs
+++ b/tests/rustdoc-json/primitives/local_primitive.rs
@@ -8,7 +8,7 @@
//! Link to [i32][prim@i32] [i64][prim@i64]
-#[doc(primitive = "i32")]
+#[rustc_doc_primitive = "i32"]
mod prim_i32 {}
// @set local_i32 = "$.index[*][?(@.name=='i32')].id"
diff --git a/tests/rustdoc-json/primitives/primitive_impls.rs b/tests/rustdoc-json/primitives/primitive_impls.rs
index 1fc937406..85d179ee4 100644
--- a/tests/rustdoc-json/primitives/primitive_impls.rs
+++ b/tests/rustdoc-json/primitives/primitive_impls.rs
@@ -25,7 +25,7 @@ pub trait Trait {}
impl Trait for i32 {}
/// i32
-#[doc(primitive = "i32")]
+#[rustc_doc_primitive = "i32"]
mod prim_i32 {}
// @set i32 = "$.index[*][?(@.docs=='i32')].id"
diff --git a/tests/rustdoc-json/primitives/primitive_overloading.rs b/tests/rustdoc-json/primitives/primitive_overloading.rs
index 56b35cd14..81e0acdc6 100644
--- a/tests/rustdoc-json/primitives/primitive_overloading.rs
+++ b/tests/rustdoc-json/primitives/primitive_overloading.rs
@@ -2,7 +2,7 @@
// Regression test for <https://github.com/rust-lang/rust/issues/98006>.
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![feature(no_core)]
#![no_core]
@@ -10,7 +10,7 @@
// @has "$.index[*][?(@.name=='usize')]"
// @has "$.index[*][?(@.name=='prim')]"
-#[doc(primitive = "usize")]
+#[rustc_doc_primitive = "usize"]
/// This is the built-in type `usize`.
mod prim {
}
diff --git a/tests/rustdoc-json/primitives/use_primitive.rs b/tests/rustdoc-json/primitives/use_primitive.rs
index e22927374..5180a804f 100644
--- a/tests/rustdoc-json/primitives/use_primitive.rs
+++ b/tests/rustdoc-json/primitives/use_primitive.rs
@@ -1,8 +1,8 @@
// edition:2018
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
-#[doc(primitive = "usize")]
+#[rustc_doc_primitive = "usize"]
mod usize {}
// @set local_crate_id = "$.index[*][?(@.name=='use_primitive')].crate_id"