Skip to content

Commit cf52c4b

Browse files
committed
Auto merge of rust-lang#16221 - holly-hacker:fix-16200, r=lnicola
fix: Fix out-of-bounds panic in some macros due to unhandled self_ref Fixes rust-lang#16200 I don't fully understand these changes, I just applied and tested the changes suggested in rust-lang#16200 and they seem to fix the issue on both the repro and my original project.
2 parents e872f50 + c133309 commit cf52c4b

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)