2022-02-13 15:39:07 -06:00
|
|
|
// check-pass
|
2022-02-13 21:57:23 -06:00
|
|
|
// edition:2018
|
2022-02-13 15:39:07 -06:00
|
|
|
|
|
|
|
#![feature(ptr_metadata)]
|
2022-02-13 21:57:23 -06:00
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
|
|
|
|
type Opaque = impl std::future::Future;
|
|
|
|
|
|
|
|
fn opaque() -> Opaque {
|
|
|
|
async {}
|
|
|
|
}
|
2022-02-13 15:39:07 -06:00
|
|
|
|
|
|
|
fn a<T>() {
|
2022-02-13 21:57:23 -06:00
|
|
|
// type parameter T is known to be sized
|
|
|
|
is_thin::<T>();
|
|
|
|
// tail of ADT (which is a type param) is known to be sized
|
|
|
|
is_thin::<std::cell::Cell<T>>();
|
|
|
|
// opaque type is known to be sized
|
|
|
|
is_thin::<Opaque>();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn a2<T: Iterator>() {
|
|
|
|
// associated type is known to be sized
|
|
|
|
is_thin::<T::Item>();
|
2022-02-13 15:39:07 -06:00
|
|
|
}
|
|
|
|
|
2022-02-13 21:57:23 -06:00
|
|
|
fn is_thin<T: std::ptr::Pointee<Metadata = ()>>() {}
|
2022-02-13 15:39:07 -06:00
|
|
|
|
|
|
|
fn main() {}
|