diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-18 14:49:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-18 14:49:20 +0200 |
| commit | d3bc06ecb499a2e7b08ec8024215205f2ae5becf (patch) | |
| tree | 30e20c349a41e881bb3aaf324b4dbfbc999db2b6 /compiler/rustc_resolve/src/macros.rs | |
| parent | 35b1f759e715afd5d5a68e657d808430d6dbbe4e (diff) | |
| parent | 998df3a3e851908afd05c3318f16d99849af5c55 (diff) | |
| download | rust-d3bc06ecb499a2e7b08ec8024215205f2ae5becf.tar.gz rust-d3bc06ecb499a2e7b08ec8024215205f2ae5becf.zip | |
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.
Diffstat (limited to 'compiler/rustc_resolve/src/macros.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/macros.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 77ef7f56c09..0e8904a7dea 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -530,7 +530,7 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> { target_trait.for_each_child(self, |this, ident, ns, _binding| { // FIXME: Adjust hygiene for idents from globs, like for glob imports. if let Some(overriding_keys) = this.impl_binding_keys.get(&impl_def_id) - && overriding_keys.contains(&BindingKey::new(ident.normalize_to_macros_2_0(), ns)) + && overriding_keys.contains(&BindingKey::new(ident, ns)) { // The name is overridden, do not produce it from the glob delegation. } else { |
