1#![no_std] 2#![deny(unsafe_code)] 3 4#[macro_use] 5extern crate static_assertions; 6 7use core::ops::Range; 8 9trait Tri<A: ?Sized, B: ?Sized, C: ?Sized> {} 10 11impl<T, A: ?Sized, B: ?Sized, C: ?Sized> Tri<A, B, C> for T {} 12 13assert_impl_all!(u64: Tri<[&'static u8], dyn Tri<dyn Send, dyn Sync, str>, (u16, u16)>); 14assert_impl_all!(u8: Send, Sync); 15assert_impl_all!(&'static [u8]: IntoIterator<Item=&'static u8>); 16assert_impl_all!(Range<u8>: Iterator<Item=u8>); 17assert_impl_all!([u8]: Send, Sync, AsRef<[u8]>); 18assert_impl_all!(str: Send, Sync, AsRef<[u8]>,); 19 20assert_impl_any!((): Send, Sync); 21assert_impl_any!((): Send, From<u8>); 22assert_impl_any!((): From<u8>, From<u16>, Send); 23 24#[allow(dead_code)] 25struct Foo; 26 27trait A {} 28trait B {} 29trait C {} 30 31impl B for Foo {} 32 33assert_impl_one!(Foo: A, B); 34assert_impl_one!(Foo: B, A); 35assert_impl_one!(Foo: B, C); 36assert_impl_one!(Foo: C, B); 37assert_impl_one!(Foo: A, B, C); 38assert_impl_one!(Foo: B, C, A); 39assert_impl_one!(Foo: C, A, B); 40