summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/parent_generics_of_encoding.rs
blob: b87e3960fc92ccb8f5ae8f67656d674d9e506c0b (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
25
// aux-build:generics_of_parent.rs
// check-pass
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

extern crate generics_of_parent;

use generics_of_parent::{Foo, S};

fn main() {
    // regression test for #87603
    const N: usize = 2;
    let x: S<u8, N> = S::test();
}

// regression test for #87674
fn new<U>(a: U) -> U {
    a
}
fn foo<const N: usize>(bar: &mut Foo<N>)
where
    [(); N + 1]: ,
{
    *bar = new(loop {});
}