incr.comp.: Possible cross-session instability in DefPath #42550
Labels
A-incr-comp
Area: Incremental compilation
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
It seems problematic to me that
DefPathData
(the components of aDefPath
) useIdent
for storing their string fields becauseIdent
containsSyntaxContext
, which, if I understand it correctly, is a monotonically increasing interning key/ID. As a consequence, changing something somewhere involving a newSyntaxContext
might have non-local effects, as theu32
in there possibly gets shifted for all subsequentIdent
s. This would be unfortunate because avoiding issues of this kind is the reason we introducedDefPath
for in the first place.My question is: Why do we even use
Ident
here in the first place? Wouldn'tInternedString
orSymbol
be sufficient?DefPath
already has a mechanism for disambiguating things that have the same string value (seeDisambiguatedDefPathData
).cc @jseyfried and the rest of @rust-lang/compiler
The text was updated successfully, but these errors were encountered: