]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/impl-trait-with-const-arguments.rs
Rollup merge of #79399 - pickfire:patch-3, r=JohnTitor
[rust.git] / src / test / ui / const-generics / impl-trait-with-const-arguments.rs
1 // revisions: full min
2
3 #![cfg_attr(full, allow(incomplete_features))]
4 #![cfg_attr(full, feature(const_generics))]
5
6 trait Usizer {
7     fn m(self) -> usize;
8 }
9
10 fn f<const N: usize>(u: impl Usizer) -> usize {
11     N + u.m()
12 }
13
14 struct Usizable;
15
16 impl Usizer for Usizable {
17     fn m(self) -> usize {
18         16
19     }
20 }
21
22 fn main() {
23     assert_eq!(f::<4usize>(Usizable), 20usize);
24 //~^ ERROR cannot provide explicit generic arguments when `impl Trait` is used in argument position
25 }