diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /tests/rustdoc/inline_cross/auxiliary | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc/inline_cross/auxiliary')
15 files changed, 133 insertions, 10 deletions
diff --git a/tests/rustdoc/inline_cross/auxiliary/async-fn.rs b/tests/rustdoc/inline_cross/auxiliary/async-fn.rs index 767564ed1..564ca7d67 100644 --- a/tests/rustdoc/inline_cross/auxiliary/async-fn.rs +++ b/tests/rustdoc/inline_cross/auxiliary/async-fn.rs @@ -1,4 +1,3 @@ -#![feature(async_fn_in_trait)] // edition: 2021 pub async fn load() -> i32 { diff --git a/tests/rustdoc/inline_cross/auxiliary/attributes.rs b/tests/rustdoc/inline_cross/auxiliary/attributes.rs new file mode 100644 index 000000000..c6f155d4b --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/attributes.rs @@ -0,0 +1,2 @@ +#[non_exhaustive] +pub struct NonExhaustive; diff --git a/tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs b/tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs new file mode 100644 index 000000000..b0c21ffae --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs @@ -0,0 +1,16 @@ +#![feature(effects, const_trait_impl)] + +#[const_trait] +pub trait Resource {} + +pub const fn load<R: ~const Resource>() -> i32 { + 0 +} + +pub const fn lock<R: Resource>() {} + +#[allow(non_upper_case_globals)] +pub trait Clash<const host: u64> {} + +#[allow(non_upper_case_globals)] +pub const fn clash<T: Clash<host>, const host: u64>() {} diff --git a/tests/rustdoc/inline_cross/auxiliary/const-fn.rs b/tests/rustdoc/inline_cross/auxiliary/const-fn.rs deleted file mode 100644 index 26332b419..000000000 --- a/tests/rustdoc/inline_cross/auxiliary/const-fn.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![feature(effects)] - -pub const fn load() -> i32 { - 0 -} diff --git a/tests/rustdoc/inline_cross/auxiliary/default-generic-args.rs b/tests/rustdoc/inline_cross/auxiliary/default-generic-args.rs new file mode 100644 index 000000000..1e31f1892 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/default-generic-args.rs @@ -0,0 +1,45 @@ +pub type BoxedStr = Box<str>; +pub type IntMap = std::collections::HashMap<i64, u64>; + +pub struct TyPair<T, U = T>(T, U); + +pub type T0 = TyPair<i32>; +pub type T1 = TyPair<i32, u32>; +pub type T2<K> = TyPair<i32, K>; +pub type T3<Q> = TyPair<Q, Q>; + +pub struct CtPair<const C: u32, const D: u32 = C>; + +pub type C0 = CtPair<43, 43>; +pub type C1 = CtPair<0, 1>; +pub type C2 = CtPair<{1 + 2}, 3>; + +pub struct Re<'a, U = &'a ()>(&'a (), U); + +pub type R0<'q> = Re<'q>; +pub type R1<'q> = Re<'q, &'q ()>; +pub type R2<'q> = Re<'q, &'static ()>; +pub type H0 = fn(for<'a> fn(Re<'a>)); +pub type H1 = for<'b> fn(for<'a> fn(Re<'a, &'b ()>)); +pub type H2 = for<'a> fn(for<'b> fn(Re<'a, &'b ()>)); + +pub struct Proj<T: Basis, U = <T as Basis>::Assoc>(T, U); +pub trait Basis { type Assoc; } +impl Basis for () { type Assoc = bool; } + +pub type P0 = Proj<()>; +pub type P1 = Proj<(), bool>; +pub type P2 = Proj<(), ()>; + +pub struct Alpha<T = for<'any> fn(&'any ())>(T); + +pub type A0 = Alpha; +pub type A1 = Alpha<for<'arbitrary> fn(&'arbitrary ())>; + +pub struct Multi<A = u64, B = u64>(A, B); + +pub type M0 = Multi<u64, ()>; + +pub trait Trait<'a, T = &'a ()> {} + +pub type F = dyn for<'a> Trait<'a>; diff --git a/tests/rustdoc/inline_cross/auxiliary/fn-type.rs b/tests/rustdoc/inline_cross/auxiliary/fn-type.rs new file mode 100644 index 000000000..dacda516b --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/fn-type.rs @@ -0,0 +1 @@ +pub type F = for<'z, 'a, '_unused> fn(&'z for<'b> fn(&'b str), &'a ()) -> &'a (); diff --git a/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs b/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs index 42cfc3dc3..fa61312eb 100644 --- a/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs +++ b/tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs @@ -15,7 +15,7 @@ pub fn func4<T: Iterator<Item = impl Clone>>(_x: T) {} pub fn func5( _f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other<T<'r> = ()>, - _a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(&'beta ())>, + _a: impl for<'beta, 'alpha, '_gamma> Auxiliary<'alpha, Item<'beta> = fn(&'beta ())>, ) {} pub trait Other { diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-21801.rs b/tests/rustdoc/inline_cross/auxiliary/issue-21801.rs new file mode 100644 index 000000000..732612ff0 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/issue-21801.rs @@ -0,0 +1,9 @@ +// compile-flags: -Cmetadata=aux + +pub struct Foo; + +impl Foo { + pub fn new<F>(f: F) -> Foo where F: FnMut() -> i32 { + loop {} + } +} diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-23207-1.rs b/tests/rustdoc/inline_cross/auxiliary/issue-23207-1.rs new file mode 100644 index 000000000..8531d5f1a --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/issue-23207-1.rs @@ -0,0 +1,3 @@ +pub mod fmt { + pub struct Error; +} diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-23207-2.rs b/tests/rustdoc/inline_cross/auxiliary/issue-23207-2.rs new file mode 100644 index 000000000..b92b16653 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/issue-23207-2.rs @@ -0,0 +1,5 @@ +extern crate issue_23207_1; + +pub mod fmt { + pub use issue_23207_1::fmt::Error; +} diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-27362-aux.rs b/tests/rustdoc/inline_cross/auxiliary/issue-27362-aux.rs new file mode 100644 index 000000000..077bdc33e --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/issue-27362-aux.rs @@ -0,0 +1,10 @@ +// compile-flags: -Cmetadata=aux + +pub const fn foo() {} +pub const unsafe fn bar() {} + +pub struct Foo; + +impl Foo { + pub const unsafe fn baz() {} +} diff --git a/tests/rustdoc/inline_cross/auxiliary/issue-29584.rs b/tests/rustdoc/inline_cross/auxiliary/issue-29584.rs new file mode 100644 index 000000000..a9b8796c0 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/issue-29584.rs @@ -0,0 +1,10 @@ +// compile-flags: -Cmetadata=aux + +pub struct Foo; + +#[doc(hidden)] +mod bar { + trait Bar {} + + impl Bar for ::Foo {} +} diff --git a/tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs b/tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs new file mode 100644 index 000000000..9170be168 --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/non_lifetime_binders.rs @@ -0,0 +1,10 @@ +#![feature(non_lifetime_binders)] + +pub trait Trait<T> {} + +pub fn f(_: impl for<T> Trait<T>) {} + +pub fn g<T>(_: T) +where + T: for<U> Trait<U>, +{} diff --git a/tests/rustdoc/inline_cross/auxiliary/repr.rs b/tests/rustdoc/inline_cross/auxiliary/repr.rs index 4a6648a64..35f08c11b 100644 --- a/tests/rustdoc/inline_cross/auxiliary/repr.rs +++ b/tests/rustdoc/inline_cross/auxiliary/repr.rs @@ -10,7 +10,7 @@ pub struct ReprSimd { } #[repr(transparent)] pub struct ReprTransparent { - field: u8, + pub field: u8, } #[repr(isize)] pub enum ReprIsize { @@ -20,3 +20,23 @@ pub enum ReprIsize { pub enum ReprU8 { Bla, } + +#[repr(transparent)] // private +pub struct ReprTransparentPrivField { + field: u32, // non-1-ZST field +} + +#[repr(transparent)] // public +pub struct ReprTransparentPriv1ZstFields { + marker0: Marker, + pub main: u64, // non-1-ZST field + marker1: Marker, +} + +#[repr(transparent)] // private +pub struct ReprTransparentPrivFieldPub1ZstFields { + main: [u16; 0], // non-1-ZST field + pub marker: Marker, +} + +pub struct Marker; // 1-ZST diff --git a/tests/rustdoc/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs b/tests/rustdoc/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs index c72f01115..08a3f5176 100644 --- a/tests/rustdoc/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs +++ b/tests/rustdoc/inline_cross/auxiliary/ret-pos-impl-trait-in-trait.rs @@ -1,5 +1,3 @@ -#![feature(return_position_impl_trait_in_trait)] - pub trait Trait { fn create() -> impl Iterator<Item = u64> { std::iter::empty() |