@@ -149,15 +149,16 @@ fn apply_mark_internal(
149149 transparency : Transparency ,
150150) -> SyntaxContextId {
151151 let syntax_context_data = db. lookup_intern_syntax_context ( ctxt) ;
152- let mut opaque = syntax_context_data. opaque ;
153- let mut opaque_and_semitransparent = syntax_context_data. opaque_and_semitransparent ;
152+ let mut opaque = handle_self_ref ( ctxt, syntax_context_data. opaque ) ;
153+ let mut opaque_and_semitransparent =
154+ handle_self_ref ( ctxt, syntax_context_data. opaque_and_semitransparent ) ;
154155
155156 if transparency >= Transparency :: Opaque {
156- let parent = handle_self_ref ( ctxt, opaque) ;
157+ let parent = opaque;
158+ // Unlike rustc, with salsa we can't prefetch the to be allocated ID to create cycles with
159+ // salsa when interning, so we use a sentinel value that effectively means the current
160+ // syntax context.
157161 let new_opaque = SyntaxContextId :: SELF_REF ;
158- // But we can't just grab the to be allocated ID either as that would not deduplicate
159- // things!
160- // So we need a new salsa store type here ...
161162 opaque = db. intern_syntax_context ( SyntaxContextData {
162163 outer_expn : call_id,
163164 outer_transparency : transparency,
@@ -168,7 +169,10 @@ fn apply_mark_internal(
168169 }
169170
170171 if transparency >= Transparency :: SemiTransparent {
171- let parent = handle_self_ref ( ctxt, opaque_and_semitransparent) ;
172+ let parent = opaque_and_semitransparent;
173+ // Unlike rustc, with salsa we can't prefetch the to be allocated ID to create cycles with
174+ // salsa when interning, so we use a sentinel value that effectively means the current
175+ // syntax context.
172176 let new_opaque_and_semitransparent = SyntaxContextId :: SELF_REF ;
173177 opaque_and_semitransparent = db. intern_syntax_context ( SyntaxContextData {
174178 outer_expn : call_id,
0 commit comments