Skip to content

Commit

Permalink
ConstEval - Add another intrincis (needs_drop)
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Jan 21, 2024
1 parent 07320d3 commit 3b282bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hir_conv/constant_evaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,10 @@ namespace HIR {
auto ty = ms.monomorph_type(state.sp, te->params.m_types.at(0));
dst.write_ptr(state, EncodedLiteral::PTR_BASE, StaticRefPtr::allocate(HIR::Path(mv$(ty), "#type_id"), nullptr));
}
else if( te->name == "needs_drop" ) {
auto ty = ms.monomorph_type(state.sp, te->params.m_types.at(0));
dst.write_uint(state, 8, state.m_resolve.type_needs_drop_glue(state.sp, ty) ? 1 : 0);
}
else if( te->name == "caller_location" ) {
auto ty_path = state.m_resolve.m_crate.get_lang_item_path(state.sp, "panic_location");
auto ty = HIR::TypeRef::new_path(ty_path, &state.m_resolve.m_crate.get_struct_by_path(state.sp, ty_path));
Expand Down

0 comments on commit 3b282bd

Please sign in to comment.