]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/const-args.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / impl-trait / explicit-generic-args-with-impl-trait / const-args.rs
1 // check-pass
2
3 trait Usizer {
4 fn m(self) -> usize;
5 }
6
7 fn f<const N: usize>(u: impl Usizer) -> usize {
8 N + u.m()
9 }
10
11 struct Usizable;
12
13 impl Usizer for Usizable {
14 fn m(self) -> usize {
15 16
16 }
17 }
18
19 fn main() {
20 assert_eq!(f::<4usize>(Usizable), 20usize);
21 }