]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/try_unify_ignore_lifetimes.rs
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / const-generics / try_unify_ignore_lifetimes.rs
1 // check-pass
2 #![feature(generic_const_exprs)]
3 #![allow(incomplete_features)]
4
5 struct Num<const N: usize>;
6
7 trait NumT {
8     const VALUE: usize;
9 }
10
11 impl<const N: usize> NumT for Num<N> {
12     const VALUE: usize = N;
13 }
14
15 struct Foo<'a, N: NumT>(&'a [u32; N::VALUE]) where [(); N::VALUE]:;
16
17 trait Bar {
18     type Size: NumT;
19
20     fn bar<'a>(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
21         todo!();
22     }
23 }
24
25 trait Baz<'a> {
26     type Size: NumT;
27
28     fn baz(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
29         todo!();
30     }
31 }
32
33 fn main() {}