diff options
Diffstat (limited to 'compiler/rustc_resolve/src/imports.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/imports.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 0a86374d76d..f2cc50c199f 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -2,7 +2,7 @@ use crate::diagnostics::{import_candidates, Suggestion}; use crate::Determinacy::{self, *}; -use crate::Namespace::{self, *}; +use crate::Namespace::*; use crate::{module_to_string, names_to_string, ImportSuggestion}; use crate::{AmbiguityKind, BindingKey, ModuleKind, ResolutionError, Resolver, Segment}; use crate::{Finalize, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet}; @@ -371,31 +371,6 @@ impl<'a> Resolver<'a> { self.used_imports.insert(import.id); } } - - /// Take primary and additional node IDs from an import and select one that corresponds to the - /// given namespace. The logic must match the corresponding logic from `fn lower_use_tree` that - /// assigns resolutons to IDs. - pub(crate) fn import_id_for_ns(&self, import: &Import<'_>, ns: Namespace) -> NodeId { - if let ImportKind::Single { additional_ids: (id1, id2), .. } = import.kind { - if let Some(resolutions) = self.import_res_map.get(&import.id) { - assert!(resolutions[ns].is_some(), "incorrectly finalized import"); - return match ns { - TypeNS => import.id, - ValueNS => match resolutions.type_ns { - Some(_) => id1, - None => import.id, - }, - MacroNS => match (resolutions.type_ns, resolutions.value_ns) { - (Some(_), Some(_)) => id2, - (Some(_), None) | (None, Some(_)) => id1, - (None, None) => import.id, - }, - }; - } - } - - import.id - } } /// An error that may be transformed into a diagnostic later. Used to combine multiple unresolved |
