]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/defaults/mismatched_ty_const_in_trait_impl.rs
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / const-generics / defaults / mismatched_ty_const_in_trait_impl.rs
1 trait Trait {
2     fn foo<U>() {}
3 }
4 impl Trait for () {
5     fn foo<const M: u64>() {}
6     //~^ error: method `foo` has an incompatible generic parameter for trait
7 }
8
9 trait Other {
10     fn bar<const M: u8>() {}
11 }
12 impl Other for () {
13     fn bar<T>() {}
14     //~^ error: method `bar` has an incompatible generic parameter for trait
15 }
16
17 trait Uwu {
18     fn baz<const N: u32>() {}
19 }
20 impl Uwu for () {
21     fn baz<const N: i32>() {}
22     //~^ error: method `baz` has an incompatible generic parameter for trait
23 }
24
25 trait Aaaaaa {
26     fn bbbb<const N: u32, T>() {}
27 }
28 impl Aaaaaa for () {
29     fn bbbb<T, const N: u32>() {}
30     //~^ error: method `bbbb` has an incompatible generic parameter for trait
31 }
32
33 trait Names {
34     fn abcd<T, const N: u32>() {}
35 }
36 impl Names for () {
37     fn abcd<const N: u32, T>() {}
38     //~^ error: method `abcd` has an incompatible generic parameter for trait
39 }
40
41 fn main() {}