]>
Commit | Line | Data |
---|---|---|
353b0b11 FG |
1 | // compile-flags: -Ztrait-solver=next |
2 | // revisions: pass fail | |
3 | //[pass] check-pass | |
4 | ||
5 | struct Wrapper<T, const N: usize>([T; N]); | |
6 | ||
7 | trait Foo {} | |
8 | fn needs_foo<F: Foo>() {} | |
9 | ||
10 | #[cfg(fail)] | |
11 | impl<T> Foo for [T; 1] {} | |
12 | ||
13 | #[cfg(pass)] | |
14 | impl<T, const N: usize> Foo for [T; N] {} | |
15 | ||
16 | fn test<T, const N: usize>() { | |
17 | needs_foo::<[T; N]>(); | |
18 | //[fail]~^ ERROR the trait bound `[T; N]: Foo` is not satisfied | |
19 | } | |
20 | ||
21 | fn main() {} |