]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0741.md
Auto merge of #66396 - smmalis37:pythontest, r=alexcrichton
[rust.git] / src / librustc_error_codes / error_codes / E0741.md
1 Only `structural_match` types (that is, types that derive `PartialEq` and `Eq`)
2 may be used as the types of const generic parameters.
3
4 ```compile_fail,E0741
5 #![feature(const_generics)]
6
7 struct A;
8
9 struct B<const X: A>; // error!
10 ```
11
12 To fix this example, we derive `PartialEq` and `Eq`.
13
14 ```
15 #![feature(const_generics)]
16
17 #[derive(PartialEq, Eq)]
18 struct A;
19
20 struct B<const X: A>; // ok!
21 ```