]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / const-generics / defaults / generic-expr-default-mismatched-types.rs
1 #![feature(generic_const_exprs, const_generics_defaults)]
2 #![allow(incomplete_features)]
3
4 struct Foo<const N: usize, const M: usize = { N + 1 }>;
5 fn should_unify<const N: usize>() -> Foo<N> where [(); { N + 1 }]: {
6 Foo::<N, { N + 1 }>
7 }
8 pub fn shouldnt_unify<const N: usize>() -> Foo<N>
9 where
10 [(); { N + 1 }]:,
11 [(); { N + 2 }]:, {
12 Foo::<N, { N + 2 }>
13 //~^ error: mismatched types
14 }
15
16 fn main() {}