diff options
| author | Jack Wrenn <jack@wrenn.fyi> | 2022-07-20 19:57:55 +0000 |
|---|---|---|
| committer | Jack Wrenn <jack@wrenn.fyi> | 2022-07-27 17:33:56 +0000 |
| commit | 18751a708a5831dffcd3b95755496efdaf7ae7a0 (patch) | |
| tree | b97baaebbcf41923e1f26f1b54ab8950fef1b90d /compiler/rustc_trait_selection/src | |
| parent | bc4a1dea416e1695cf77acd17ea743d4d802bae0 (diff) | |
| download | rust-18751a708a5831dffcd3b95755496efdaf7ae7a0.tar.gz rust-18751a708a5831dffcd3b95755496efdaf7ae7a0.zip | |
safe transmute: gracefully handle const params of wrong types
ref: https://github.com/rust-lang/rust/pull/92268/files#r925244819
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |
