]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
29967ef6
XL
1trait Usizer {
2 fn m(self) -> usize;
3}
4
5fn f<const N: usize>(u: impl Usizer) -> usize {
6 N + u.m()
7}
8
9struct Usizable;
10
11impl Usizer for Usizable {
12 fn m(self) -> usize {
13 16
14 }
15}
16
17fn main() {
18 assert_eq!(f::<4usize>(Usizable), 20usize);
19//~^ ERROR cannot provide explicit generic arguments when `impl Trait` is used in argument position
20}