about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-05 11:50:43 +0000
committerbors <bors@rust-lang.org>2025-05-05 11:50:43 +0000
commit243c5a35e18b2634892fe7091d5ee888a18f77f5 (patch)
tree5614a95feb86b1c1ddca388b543421da003e43e7 /library/alloc/src
parent0eb0b8cb67ff2c37eab775eaac6b330347e5c97f (diff)
parentacb50d5136c99446f533091387b9ed03f2d395bb (diff)
downloadrust-243c5a35e18b2634892fe7091d5ee888a18f77f5.tar.gz
rust-243c5a35e18b2634892fe7091d5ee888a18f77f5.zip
Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type

This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct  `DisambiguatorState` instances must ensure that that the def paths are unique without its help.

Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer.

`DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those.

cc `@oli-obk`
Diffstat (limited to 'library/alloc/src')
0 files changed, 0 insertions, 0 deletions