From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/rustdoc-json/fns/extern_c_variadic.rs | 9 ++++++++ .../impls/local_for_local_primitive.rs | 4 ++-- tests/rustdoc-json/non_lifetime_binders.rs | 24 ++++++++++++++++++++++ tests/rustdoc-json/primitives/local_primitive.rs | 2 +- tests/rustdoc-json/primitives/primitive_impls.rs | 2 +- .../primitives/primitive_overloading.rs | 4 ++-- tests/rustdoc-json/primitives/use_primitive.rs | 4 ++-- 7 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 tests/rustdoc-json/fns/extern_c_variadic.rs create mode 100644 tests/rustdoc-json/non_lifetime_binders.rs (limited to 'tests/rustdoc-json') 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; + +pub struct Wrapper(PhantomData); + +// @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: 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 . -#![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" -- cgit v1.2.3