]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/parser-error-recovery/issue-89013.rs
d5ded44188a02c960242a5bd53b1ab5731af50a9
[rust.git] / src / test / ui / const-generics / parser-error-recovery / issue-89013.rs
1 trait Foo<const N: usize> {
2     fn do_x(&self) -> [u8; N];
3 }
4
5 struct Bar;
6
7 const T: usize = 42;
8
9 impl Foo<N = const 3> for Bar {
10 //~^ERROR expected lifetime, type, or constant, found keyword `const`
11 //~^^ERROR cannot constrain an associated constant to a value
12 //~^^^ERROR this trait takes 1 generic argument but 0 generic arguments
13 //~^^^^ERROR associated type bindings are not allowed here
14     fn do_x(&self) -> [u8; 3] {
15         [0u8; 3]
16     }
17 }
18
19 fn main() {}