]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs
Rollup merge of #74141 - euclio:typos, r=steveklabnik
[rust.git] / src / test / ui / const-generics / type-dependent / const-arg-in-const-arg.rs
1 // run-pass
2 #![feature(const_generics)]
3 #![allow(incomplete_features)]
4 #![feature(const_fn)]
5
6 struct Foo;
7
8 impl Foo {
9     fn foo<const N: usize>(&self) -> usize {
10         let f = self;
11         f.bar::<{
12             let f = Foo;
13             f.bar::<7>()
14         }>() + N
15     }
16
17     const fn bar<const M: usize>(&self) -> usize {
18         M
19     }
20 }
21
22 fn main() {
23     let f = Foo;
24
25     assert_eq!(f.foo::<13>(), 20)
26 }