summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/issues/issue-89304.rs
blob: d544d637cc490e258e4cae215c7c297842c6e77b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// check-pass

#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

struct GenericStruct<const T: usize> { val: i64 }

impl<const T: usize> From<GenericStruct<T>> for GenericStruct<{T + 1}> {
    fn from(other: GenericStruct<T>) -> Self {
        Self { val: other.val }
    }
}

impl<const T: usize> From<GenericStruct<{T + 1}>> for GenericStruct<T> {
    fn from(other: GenericStruct<{T + 1}>) -> Self {
        Self { val: other.val }
    }
}

fn main() {}