]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/impl-trait-with-const-arguments.rs
Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f994e23415f8f6bb5686ff2...
[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 #![cfg_attr(min, feature(min_const_generics))]
6
7 trait Usizer {
8     fn m(self) -> usize;
9 }
10
11 fn f<const N: usize>(u: impl Usizer) -> usize {
12     N + u.m()
13 }
14
15 struct Usizable;
16
17 impl Usizer for Usizable {
18     fn m(self) -> usize {
19         16
20     }
21 }
22
23 fn main() {
24     assert_eq!(f::<4usize>(Usizable), 20usize);
25 //~^ ERROR cannot provide explicit generic arguments when `impl Trait` is used in argument position
26 }