]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/auxiliary/crayte.rs
add cross crate test
[rust.git] / src / test / ui / const-generics / auxiliary / crayte.rs
1 // edition:2018
2 #![cfg_attr(full, feature(const_generics))]
3 #![cfg_attr(full, allow(incomplete_features))]
4 #![cfg_attr(min, feature(min_const_generics))]
5
6 pub trait Foo<const N: usize> {}
7 struct Local;
8 impl<const N: usize> Foo<N> for Local {}
9
10 pub fn out_foo<const N: usize>() -> impl Foo<N> { Local }
11 pub fn in_foo<const N: usize>(_: impl Foo<N>) {}
12
13 pub async fn async_simple<const N: usize>(_: [u8; N]) {}
14 pub async fn async_out_foo<const N: usize>() -> impl Foo<N> { Local }
15 pub async fn async_in_foo<const N: usize>(_: impl Foo<N>) {}
16
17 pub trait Bar<const N: usize> {
18     type Assoc: Foo<N>;
19 }