Skip to content

Commit b991f9a

Browse files
committed
Add is_const_eval intrinsic
1 parent 0c77a10 commit b991f9a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/shims/intrinsics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
223223
let discr_val = this.read_discriminant(place.into())?.0;
224224
this.write_scalar(Scalar::from_uint(discr_val, dest.layout.size), dest)?;
225225
}
226+
"is_const_eval" => {
227+
this.write_scalar(Scalar::from_u8(1), dest)?;
228+
}
226229

227230
"sinf32" | "fabsf32" | "cosf32" | "sqrtf32" | "expf32" | "exp2f32" | "logf32" |
228231
"log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" | "roundf32" => {

0 commit comments

Comments
 (0)