]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/impl-trait-with-const-arguments.rs
Move generic error message to separate branches
[rust.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 }