2020-05-17 23:00:19 -04:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(staged_api)]
|
|
|
|
#![stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub trait Trait1<#[unstable(feature = "unstable_default", issue = "none")] T = ()> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
fn foo() -> T;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub trait Trait2<#[unstable(feature = "unstable_default", issue = "none")] T = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
fn foo() -> T;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub trait Trait3<T = ()> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
fn foo() -> T;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Struct1<#[unstable(feature = "unstable_default", issue = "none")] T = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field: T,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Struct2<T = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field: T,
|
|
|
|
}
|
|
|
|
|
2020-06-22 00:08:54 -04:00
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Struct3<A = isize, #[unstable(feature = "unstable_default", issue = "none")] B = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field1: A,
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field2: B,
|
|
|
|
}
|
2020-05-17 23:00:19 -04:00
|
|
|
|
2020-06-25 15:53:47 -04:00
|
|
|
#[rustc_deprecated(since = "1.1.0", reason = "test")]
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Struct4<A = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field: A,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustc_deprecated(since = "1.1.0", reason = "test")]
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Struct5<#[unstable(feature = "unstable_default", issue = "none")] A = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field: A,
|
|
|
|
}
|
|
|
|
|
2020-07-11 19:24:04 -04:00
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Struct6<#[unstable(feature = "unstable_default6", issue = "none")] T = usize> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub field: T,
|
|
|
|
}
|
|
|
|
|
2020-05-17 23:00:19 -04:00
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub const STRUCT1: Struct1 = Struct1 { field: 1 };
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub const STRUCT2: Struct2 = Struct2 { field: 1 };
|
2020-06-22 00:08:54 -04:00
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub const STRUCT3: Struct3 = Struct3 { field1: 1, field2: 2 };
|
2020-06-25 15:53:47 -04:00
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub const STRUCT4: Struct4 = Struct4 { field: 1 };
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub const STRUCT5: Struct5 = Struct5 { field: 1 };
|
2020-07-12 20:56:37 -04:00
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub trait Alloc {}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct System {}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
impl Alloc for System {}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Box1<T, #[unstable(feature = "box_alloc_param", issue = "none")] A: Alloc = System> {
|
|
|
|
ptr: *mut T,
|
|
|
|
alloc: A,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Box1<T, System> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub fn new(mut t: T) -> Self {
|
|
|
|
unsafe { Self { ptr: &mut t, alloc: System {} } }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Box2<T, A: Alloc = System> {
|
|
|
|
ptr: *mut T,
|
|
|
|
alloc: A,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Box2<T, System> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub fn new(mut t: T) -> Self {
|
|
|
|
Self { ptr: &mut t, alloc: System {} }
|
|
|
|
}
|
|
|
|
}
|
2020-07-12 21:02:47 -04:00
|
|
|
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub struct Box3<T> {
|
|
|
|
ptr: *mut T,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Box3<T> {
|
|
|
|
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
|
|
|
pub fn new(mut t: T) -> Self {
|
|
|
|
Self { ptr: &mut t }
|
|
|
|
}
|
|
|
|
}
|