rust/compiler/rustc_ast_lowering
bors 243c5a35e1 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`
2025-05-05 11:50:43 +00:00
..
src Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk 2025-05-05 11:50:43 +00:00
Cargo.toml Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
messages.ftl Stabilize precise_capturing_in_traits 2025-03-23 14:11:04 +00:00