Skip to content

Commit a9eacf3

Browse files
committed
add error-in-impl-trait const generics test
1 parent 7d9f815 commit a9eacf3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// check-pass
2+
// edition:2018
3+
#![feature(min_const_generics)]
4+
trait ValidTrait {}
5+
6+
/// This has docs
7+
pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]> {
8+
loop {}
9+
}
10+
11+
pub trait Trait<const N: usize> {}
12+
impl Trait<1> for u8 {}
13+
impl Trait<2> for u8 {}
14+
impl<const N: usize> Trait<N> for [u8; N] {}
15+
16+
/// This also has docs
17+
pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
18+
loop {}
19+
}
20+
21+
/// Document all the functions
22+
pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N> {
23+
loop {}
24+
}

0 commit comments

Comments
 (0)