From a39c50b64caca297b3e98ebf7cdb68c96ca0f3c1 Mon Sep 17 00:00:00 2001 From: b-naber Date: Fri, 29 Oct 2021 12:38:28 +0200 Subject: [PATCH] add test --- .../ui/const-generics/issues/issue-89304.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-89304.rs diff --git a/src/test/ui/const-generics/issues/issue-89304.rs b/src/test/ui/const-generics/issues/issue-89304.rs new file mode 100644 index 00000000000..d544d637cc4 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-89304.rs @@ -0,0 +1,20 @@ +// check-pass + +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +struct GenericStruct { val: i64 } + +impl From> for GenericStruct<{T + 1}> { + fn from(other: GenericStruct) -> Self { + Self { val: other.val } + } +} + +impl From> for GenericStruct { + fn from(other: GenericStruct<{T + 1}>) -> Self { + Self { val: other.val } + } +} + +fn main() {}