From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/const-generics/issues/issue-71202.rs | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-71202.rs (limited to 'src/test/ui/const-generics/issues/issue-71202.rs') diff --git a/src/test/ui/const-generics/issues/issue-71202.rs b/src/test/ui/const-generics/issues/issue-71202.rs new file mode 100644 index 000000000..57fd72b12 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-71202.rs @@ -0,0 +1,31 @@ +#![feature(generic_const_exprs)] +#![allow(incomplete_features, const_evaluatable_unchecked)] + +use std::marker::PhantomData; + +struct DataHolder { + item: T, +} + +impl DataHolder { + const ITEM_IS_COPY: [(); 1 - { //~ ERROR unconstrained generic constant + trait NotCopy { + const VALUE: bool = false; + } + + impl<__Type: ?Sized> NotCopy for __Type {} + + struct IsCopy<__Type: ?Sized>(PhantomData<__Type>); + + impl<__Type> IsCopy<__Type> + where + __Type: Sized + Copy, + { + const VALUE: bool = true; + } + + >::VALUE + } as usize] = []; +} + +fn main() {} -- cgit v1.2.3