diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-27 12:56:51 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-19 18:07:35 +0000 |
| commit | e83e4e81123ea2babc04238d5aca01ec4bf3e763 (patch) | |
| tree | 82f61bf363145172ca403449b4f76fb0c0524ac4 /compiler/rustc_sanitizers | |
| parent | a2a1206811d864df2bb61b2fc27ddc45a3589424 (diff) | |
| download | rust-e83e4e81123ea2babc04238d5aca01ec4bf3e763.tar.gz rust-e83e4e81123ea2babc04238d5aca01ec4bf3e763.zip | |
Get rid of const eval_* and try_eval_* helpers
Diffstat (limited to 'compiler/rustc_sanitizers')
| -rw-r--r-- | compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs index 53834198f63..ca75952fe3d 100644 --- a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs +++ b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs @@ -133,7 +133,9 @@ fn encode_const<'tcx>( // bool value false is encoded as 0 and true as 1. match ct_ty.kind() { ty::Int(ity) => { - let bits = c.eval_bits(tcx, ty::ParamEnv::reveal_all()); + let bits = c + .try_to_bits(tcx, ty::ParamEnv::reveal_all()) + .expect("expected monomorphic const in cfi"); let val = Integer::from_int_ty(&tcx, *ity).size().sign_extend(bits) as i128; if val < 0 { s.push('n'); @@ -141,7 +143,9 @@ fn encode_const<'tcx>( let _ = write!(s, "{val}"); } ty::Uint(_) => { - let val = c.eval_bits(tcx, ty::ParamEnv::reveal_all()); + let val = c + .try_to_bits(tcx, ty::ParamEnv::reveal_all()) + .expect("expected monomorphic const in cfi"); let _ = write!(s, "{val}"); } ty::Bool => { |
