about summary refs log tree commit diff
path: root/tests/ui/const-generics/type-mismatch-in-nested-goal.rs
blob: fd29019f89bc5f760b67ef502fa13a82e3c20394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions)

trait A<const B: bool> {}

impl A<true> for () {}

fn needs_a<const N: usize>(_: [u8; N]) where (): A<N> {}
//~^ ERROR the constant `N` is not of type `bool`

pub fn main() {
    needs_a([]);
    //~^ ERROR the constant `true` is not of type `usize`
    //~| ERROR mismatched types
    // FIXME(const_generics): we should hide this error as we've already errored above
}