This commit is contained in:
edg-l 2024-03-12 11:09:57 +00:00
parent adfda37b08
commit f6fb680bd7

View file

@ -2513,15 +2513,15 @@
<span class="kw">for </span>proj <span class="kw">in </span><span class="kw-2">&amp;</span>place.projection {
<span class="kw">match </span>proj {
ir::PlaceElem::Deref =&gt; {
ptr = ctx
.builder
.build_load(compile_basic_type(ctx, <span class="kw-2">&amp;</span>local_ty), ptr, <span class="string">"deref"</span>)<span class="question-mark">?
</span>.into_pointer_value();
local_ty = <span class="kw">match </span>local_ty.kind {
ir::TypeKind::Ptr(<span class="kw">_</span>, inner) =&gt; <span class="kw-2">*</span>inner,
ir::TypeKind::Ref(<span class="kw">_</span>, inner) =&gt; <span class="kw-2">*</span>inner,
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
}
};
ptr = ctx
.builder
.build_load(compile_basic_type(ctx, <span class="kw-2">&amp;</span>local_ty), ptr, <span class="string">"deref"</span>)<span class="question-mark">?
</span>.into_pointer_value();
}
ir::PlaceElem::Field { .. } =&gt; <span class="macro">todo!</span>(),
ir::PlaceElem::Index { .. } =&gt; <span class="macro">todo!</span>(),