]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/issues/issue-87470.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / const-generics / issues / issue-87470.rs
1 // build-pass
2
3 #![feature(generic_const_exprs)]
4 #![allow(incomplete_features)]
5
6 pub trait TraitWithConst {
7 const SOME_CONST: usize;
8 }
9
10 pub trait OtherTrait: TraitWithConst {
11 fn some_fn(self) -> [u8 ; <Self as TraitWithConst>::SOME_CONST];
12 }
13
14 impl TraitWithConst for f32 {
15 const SOME_CONST: usize = 32;
16 }
17
18 impl OtherTrait for f32 {
19 fn some_fn(self) -> [u8 ; <Self as TraitWithConst>::SOME_CONST] {
20 [0; 32]
21 }
22 }
23
24 fn main() {}