diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-04-02 16:47:08 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-31 13:34:54 +0200 |
| commit | c10a1cebe785e2e47ae30228416e57f9db751e17 (patch) | |
| tree | 26af9974262483a02d72aacbf93dfa3005381a25 /compiler/rustc_resolve/src/lib.rs | |
| parent | b29fa94d22e7a20b3dd1eb8eae5e192ccbf89b58 (diff) | |
| download | rust-c10a1cebe785e2e47ae30228416e57f9db751e17.tar.gz rust-c10a1cebe785e2e47ae30228416e57f9db751e17.zip | |
Store next_disambiguator in Definitions.
Diffstat (limited to 'compiler/rustc_resolve/src/lib.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/lib.rs | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 0393a391c8a..3d31315d044 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1061,7 +1061,6 @@ pub struct Resolver<'a> { /// and how the `impl Trait` fragments were introduced. invocation_parents: FxHashMap<LocalExpnId, (LocalDefId, ImplTraitContext)>, - next_disambiguator: FxHashMap<(LocalDefId, DefPathData), u32>, /// Some way to know that we are in a *trait* impl in `visit_assoc_item`. /// FIXME: Replace with a more general AST map (together with some other fields). trait_impl_items: FxHashSet<LocalDefId>, @@ -1249,16 +1248,7 @@ impl ResolverAstLowering for Resolver<'_> { self.definitions.def_key(self.node_id_to_def_id[&node_id]), ); - // Find the next free disambiguator for this key. - let next_disambiguator = &mut self.next_disambiguator; - let next_disambiguator = |parent, data| { - let next_disamb = next_disambiguator.entry((parent, data)).or_insert(0); - let disambiguator = *next_disamb; - *next_disamb = next_disamb.checked_add(1).expect("disambiguator overflow"); - disambiguator - }; - - let def_id = self.definitions.create_def(parent, data, expn_id, next_disambiguator, span); + let def_id = self.definitions.create_def(parent, data, expn_id, span); // Some things for which we allocate `LocalDefId`s don't correspond to // anything in the AST, so they don't have a `NodeId`. For these cases @@ -1430,7 +1420,6 @@ impl<'a> Resolver<'a> { def_id_to_node_id, placeholder_field_indices: Default::default(), invocation_parents, - next_disambiguator: Default::default(), trait_impl_items: Default::default(), legacy_const_generic_args: Default::default(), item_generics_num_lifetimes: Default::default(), |
