From f989d5f08de819ec8a73833712d47113d38d2696 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 5 Mar 2022 20:07:24 -0800 Subject: [PATCH] [Demonstration] Why can skipping an `is_copy_raw` call cause an ICE? --- compiler/rustc_middle/src/ty/util.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 04e766d16cc49..44b80fba7ac76 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -704,7 +704,11 @@ impl<'tcx> Ty<'tcx> { tcx_at: TyCtxtAt<'tcx>, param_env: ty::ParamEnv<'tcx>, ) -> bool { - tcx_at.is_copy_raw(param_env.and(self)) + if let ty::Uint(ty::UintTy::U32) = self.kind() { + true + } else { + tcx_at.is_copy_raw(param_env.and(self)) + } } /// Checks whether values of this type `T` have a size known at