rust/compiler/rustc_resolve/src
Matthias Krüger d3bc06ecb4
Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obk
resolve: Make disambiguators for underscore bindings module-local

Disambiguators attached to underscore name bindings (like `const _: u8 = something;`) do not need to be globally unique, they just need to be unique inside the module in which they live, because the bindings in a module are basically kept as `Map<BindingKey, SomeData>`.

Also, the specific values of the disambiguators are not important, so a glob import of `const _` may have a different disambiguator than the original `const _` itself.

So in this PR the disambiguator is just set to the current number of bindings in the module.
This removes one more piece of global mutable state from resolver and unblocks https://github.com/rust-lang/rust/pull/143884.
2025-07-18 14:49:20 +02:00
..
late resolve: Change &mut Resolver to &Resolver when possible 2025-07-17 02:09:01 +03:00
rustdoc Update tests to work with new DocFragment field and redundant_explicit_links new API 2025-06-23 16:02:34 +02:00
build_reduced_graph.rs Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obk 2025-07-18 14:49:20 +02:00
check_unused.rs replace binding and shadowed_glob on NameResolution with non_glob_binding and glob_binding 2025-07-12 15:06:32 +02:00
def_collector.rs Fix ice for feature-gated cfg attributes applied to the crate 2025-07-15 23:28:15 +02:00
diagnostics.rs Rollup merge of #143550 - petrochenkov:lessmutres, r=lcnr 2025-07-17 10:41:44 +02:00
effective_visibilities.rs resolve: Change &mut Resolver to &Resolver when possible 2025-07-17 02:09:01 +03:00
errors.rs Rollup merge of #134006 - klensy:typos, r=nnethercote 2025-07-03 13:29:35 +02:00
ident.rs resolve: Change &mut Resolver to &Resolver when possible 2025-07-17 02:09:01 +03:00
imports.rs Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obk 2025-07-18 14:49:20 +02:00
late.rs Remove similar errors about raw underscore lifetime 2025-07-18 00:28:09 +08:00
lib.rs Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obk 2025-07-18 14:49:20 +02:00
macros.rs Rollup merge of #144013 - petrochenkov:disambunder, r=oli-obk 2025-07-18 14:49:20 +02:00
rustdoc.rs Improve path segment joining. 2025-07-17 08:37:19 +10:00