We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 511333f commit 19eaee2Copy full SHA for 19eaee2
compiler/rustc_const_eval/src/transform/check_consts/check.rs
@@ -913,6 +913,11 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
913
return;
914
}
915
916
+ if Some(callee) == tcx.lang_items().exchange_malloc_fn() {
917
+ self.check_op(ops::HeapAllocation);
918
+ return;
919
+ }
920
+
921
// `async` blocks get lowered to `std::future::from_generator(/* a closure */)`.
922
let is_async_block = Some(callee) == tcx.lang_items().from_generator_fn();
923
if is_async_block {
0 commit comments