]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/parent_generics_of_encoding.rs
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / parent_generics_of_encoding.rs
1 // aux-build:generics_of_parent.rs
2 // check-pass
3 #![feature(generic_const_exprs)]
4 #![allow(incomplete_features)]
5
6 extern crate generics_of_parent;
7
8 use generics_of_parent::{Foo, S};
9
10 fn main() {
11     // regression test for #87603
12     const N: usize = 2;
13     let x: S<u8, N> = S::test();
14 }
15
16 // regression test for #87674
17 fn new<U>(a: U) -> U {
18     a
19 }
20 fn foo<const N: usize>(bar: &mut Foo<N>)
21 where
22     [(); N + 1]: ,
23 {
24     *bar = new(loop {});
25 }