summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/const-param-placeholder.rs
blob: a83102a4cddaea339d7f6403fde9f1ac54296f00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// compile-flags: -Ztrait-solver=next
// revisions: pass fail
//[pass] check-pass

struct Wrapper<T, const N: usize>([T; N]);

trait Foo {}
fn needs_foo<F: Foo>() {}

#[cfg(fail)]
impl<T> Foo for [T; 1] {}

#[cfg(pass)]
impl<T, const N: usize> Foo for [T; N] {}

fn test<T, const N: usize>() {
    needs_foo::<[T; N]>();
    //[fail]~^ ERROR the trait bound `[T; N]: Foo` is not satisfied
}

fn main() {}