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:
parent
bc4a1dea41
commit
18751a708a
3 changed files with 68 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue