1
Fork 0

safe transmute: gracefully handle const params of wrong types

ref: https://github.com/rust-lang/rust/pull/92268/files#r925244819
This commit is contained in:
Jack Wrenn 2022-07-20 19:57:55 +00:00
parent bc4a1dea41
commit 18751a708a
3 changed files with 68 additions and 1 deletions

View file

@ -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 {