Description
It seems problematic to me that DefPathData
(the components of a DefPath
) use Ident
for storing their string fields because Ident
contains SyntaxContext
, which, if I understand it correctly, is a monotonically increasing interning key/ID. As a consequence, changing something somewhere involving a new SyntaxContext
might have non-local effects, as the u32
in there possibly gets shifted for all subsequent Ident
s. This would be unfortunate because avoiding issues of this kind is the reason we introduced DefPath
for in the first place.
My question is: Why do we even use Ident
here in the first place? Wouldn't InternedString
or Symbol
be sufficient? DefPath
already has a mechanism for disambiguating things that have the same string value (see DisambiguatedDefPathData
).
cc @jseyfried and the rest of @rust-lang/compiler