From 18751a708a5831dffcd3b95755496efdaf7ae7a0 Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Wed, 20 Jul 2022 19:57:55 +0000 Subject: safe transmute: gracefully handle const params of wrong types ref: https://github.com/rust-lang/rust/pull/92268/files#r925244819 --- compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_trait_selection/src') diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index a609fb2b172..672c9b7b088 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -288,7 +288,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { .substs .const_at(i) .try_eval_bool(self.tcx(), obligation.param_env) - .unwrap() + .unwrap_or(true) }; let src_and_dst = predicate.map_bound(|p| rustc_transmute::Types { -- cgit 1.4.1-3-g733a5