@@ -149,15 +149,16 @@ fn apply_mark_internal(
149
149
transparency : Transparency ,
150
150
) -> SyntaxContextId {
151
151
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 ) ;
154
155
155
156
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.
157
161
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 ...
161
162
opaque = db. intern_syntax_context ( SyntaxContextData {
162
163
outer_expn : call_id,
163
164
outer_transparency : transparency,
@@ -168,7 +169,10 @@ fn apply_mark_internal(
168
169
}
169
170
170
171
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.
172
176
let new_opaque_and_semitransparent = SyntaxContextId :: SELF_REF ;
173
177
opaque_and_semitransparent = db. intern_syntax_context ( SyntaxContextData {
174
178
outer_expn : call_id,
0 commit comments