]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/impl-trait-with-const-arguments.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / const-generics / impl-trait-with-const-arguments.rs
1 trait Usizer {
2 fn m(self) -> usize;
3 }
4
5 fn f<const N: usize>(u: impl Usizer) -> usize {
6 N + u.m()
7 }
8
9 struct Usizable;
10
11 impl Usizer for Usizable {
12 fn m(self) -> usize {
13 16
14 }
15 }
16
17 fn main() {
18 assert_eq!(f::<4usize>(Usizable), 20usize);
19 //~^ ERROR cannot provide explicit generic arguments when `impl Trait` is used in argument position
20 }