Skip to content

Commit c133309

Browse files
committed
Fix out-of-bounds panic in some macros due to unhandled self_ref
1 parent e872f50 commit c133309

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/hir-expand/src/hygiene.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fn apply_mark_internal(
153153
let mut opaque_and_semitransparent = syntax_context_data.opaque_and_semitransparent;
154154

155155
if transparency >= Transparency::Opaque {
156-
let parent = opaque;
156+
let parent = handle_self_ref(ctxt, opaque);
157157
let new_opaque = SyntaxContextId::SELF_REF;
158158
// But we can't just grab the to be allocated ID either as that would not deduplicate
159159
// things!
@@ -168,7 +168,7 @@ fn apply_mark_internal(
168168
}
169169

170170
if transparency >= Transparency::SemiTransparent {
171-
let parent = opaque_and_semitransparent;
171+
let parent = handle_self_ref(ctxt, opaque_and_semitransparent);
172172
let new_opaque_and_semitransparent = SyntaxContextId::SELF_REF;
173173
opaque_and_semitransparent = db.intern_syntax_context(SyntaxContextData {
174174
outer_expn: call_id,

0 commit comments

Comments
 (0)