about summary refs log tree commit diff
path: root/tests/ui/const-generics/issues/issue-86535-2.rs
blob: 5c9132fe54d3d7e350629bc11a44bdfb12ca67a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ run-pass
#![feature(adt_const_params, unsized_const_params, generic_const_exprs)]
#![allow(incomplete_features)]

pub trait Foo {
    const ASSOC_C: usize;
    fn foo()
    where
        [(); Self::ASSOC_C]:;
}

struct Bar<const N: &'static ()>; //~ WARN struct `Bar` is never constructed
impl<const N: &'static ()> Foo for Bar<N> {
    const ASSOC_C: usize = 3;

    fn foo()
    where
        [u8; Self::ASSOC_C]:,
    {
        let _: [u8; Self::ASSOC_C] = loop {};
    }
}

fn main() {}