]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-ui/error-in-impl-trait/const-generics.rs
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
[rust.git] / tests / rustdoc-ui / error-in-impl-trait / const-generics.rs
1 // check-pass
2 // edition:2018
3 trait ValidTrait {}
4
5 /// This has docs
6 pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]> {
7     loop {}
8 }
9
10 pub trait Trait<const N: usize> {}
11 impl Trait<1> for u8 {}
12 impl Trait<2> for u8 {}
13 impl<const N: usize> Trait<N> for [u8; N] {}
14
15 /// This also has docs
16 pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
17     loop {}
18 }
19
20 /// Document all the functions
21 pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N> {
22     loop {}
23 }