fn finalize_resolutions_in(&mut self, module: Module<'b>, report_unresolved_imports: bool) {
        // Since import resolution is finished, globs will not define any more names.
        *module.globs.borrow_mut() = Vec::new();

        let mut reexports = Vec::new();
        for (&(name, ns), resolution) in module.resolutions.borrow().iter() {
            let resolution = resolution.borrow();
            resolution.report_conflicts(|b1, b2| {
                self.resolver.report_conflict(module, name, ns, b1, b2)
            });

            let binding = match resolution.binding {
                Some(binding) => binding,
                None => continue,
            };

            if binding.vis == ty::Visibility::Public &&
               (binding.is_import() || binding.is_extern_crate()) {
                if let Some(def) = binding.def() {
                    reexports.push(Export { name: name, def_id: def.def_id() });
                }
            }

            if let NameBindingKind::Import { binding: orig_binding, directive, .. } = binding.kind {
                if ns == TypeNS && orig_binding.is_variant() &&
                   !orig_binding.vis.is_at_least(binding.vis, self.resolver) {
                    let msg = format!("variant `{}` is private, and cannot be reexported \
                                       (error E0364), consider declaring its enum as `pub`",
                                      name);
                    let lint = lint::builtin::PRIVATE_IN_PUBLIC;
                    self.resolver.session.add_lint(lint, directive.id, binding.span, msg);
                }
            }
        }

        if reexports.len() > 0 {
            if let Some(def_id) = module.def_id() {
                let node_id = self.resolver.definitions.as_local_node_id(def_id).unwrap();
                self.resolver.export_map.insert(node_id, reexports);
            }
        }

        if report_unresolved_imports {
            for import in module.unresolved_imports.borrow().iter() {
                resolve_error(self.resolver, import.span, ResolutionError::UnresolvedImport(None));
                break;
            }
        }
    }
// Miscellaneous post-processing, including recording reexports, reporting conflicts,
// reporting the PRIVATE_IN_PUBLIC lint, and reporting unresolved imports.
Miscellaneous post-processing, including recording reexports, reporting conflicts,
reporting the PRIVATE_IN_PUBLIC lint, and reporting unresolved imports.
Miscellaneous post - processing including recording reexports reporting conflicts reporting the PRIVATE_IN_PUBLIC lint and reporting unresolved imports .
fn finalize_resolutions_in(&mut self, module: Module<'b>, report_unresolved_imports: bool) {
        // Since import resolution is finished, globs will not define any more names.
        *module.globs.borrow_mut() = Vec::new();
        let mut reexports = Vec::new();
        for (&(name, ns), resolution) in module.resolutions.borrow().iter() {
            let resolution = resolution.borrow();
            resolution.report_conflicts(|b1, b2| {
                self.resolver.report_conflict(module, name, ns, b1, b2)
            });
            let binding = match resolution.binding {
                Some(binding) => binding,
                None => continue,
            };
            if binding.vis == ty::Visibility::Public &&
               (binding.is_import() || binding.is_extern_crate()) {
                if let Some(def) = binding.def() {
                    reexports.push(Export { name: name, def_id: def.def_id() });
                }
            }
            if let NameBindingKind::Import { binding: orig_binding, directive, .. } = binding.kind {
                if ns == TypeNS && orig_binding.is_variant() &&
                   !orig_binding.vis.is_at_least(binding.vis, self.resolver) {
                    let msg = format!("variant `{}` is private, and cannot be reexported \
                                       (error E0364), consider declaring its enum as `pub`",
                                      name);
                    let lint = lint::builtin::PRIVATE_IN_PUBLIC;
                    self.resolver.session.add_lint(lint, directive.id, binding.span, msg);
                }
            }
        }
        if reexports.len() > 0 {
            if let Some(def_id) = module.def_id() {
                let node_id = self.resolver.definitions.as_local_node_id(def_id).unwrap();
                self.resolver.export_map.insert(node_id, reexports);
            }
        }
        if report_unresolved_imports {
            for import in module.unresolved_imports.borrow().iter() {
                resolve_error(self.resolver, import.span, ResolutionError::UnresolvedImport(None));
                break;
            }
        }
    }
fn finalize_resolutions_in ( & mut self , module : Module < ' b > , report_unresolved_imports : bool ) { // Since import resolution is finished, globs will not define any more names. * module . globs . borrow_mut ( ) = Vec :: new ( ) ; let mut reexports = Vec :: new ( ) ; for ( & ( name , ns ) , resolution ) in module . resolutions . borrow ( ) . iter ( ) { let resolution = resolution . borrow ( ) ; resolution . report_conflicts ( | b1 , b2 | { self . resolver . report_conflict ( module , name , ns , b1 , b2 ) } ) ; let binding = match resolution . binding { Some ( binding ) => binding , None => continue , } ; if binding . vis == ty :: Visibility :: Public && ( binding . is_import ( ) || binding . is_extern_crate ( ) ) { if let Some ( def ) = binding . def ( ) { reexports . push ( Export { name : name , def_id : def . def_id ( ) } ) ; } } if let NameBindingKind :: Import { binding : orig_binding , directive , .. } = binding . kind { if ns == TypeNS && orig_binding . is_variant ( ) && ! orig_binding . vis . is_at_least ( binding . vis , self . resolver ) { let msg = format ! ( " \
 " name ) ; let lint = lint :: builtin :: PRIVATE_IN_PUBLIC ; self . resolver . session . add_lint ( lint , directive . id , binding . span , msg ) ; } } } if reexports . len ( ) > 0 { if let Some ( def_id ) = module . def_id ( ) { let node_id = self . resolver . definitions . as_local_node_id ( def_id ) . unwrap ( ) ; self . resolver . export_map . insert ( node_id , reexports ) ; } } if report_unresolved_imports { for import in module . unresolved_imports . borrow ( ) . iter ( ) { resolve_error ( self . resolver , import . span , ResolutionError :: UnresolvedImport ( None ) ) ; break ; } } }
Miscellaneous post-processing, including recording reexports, reporting conflicts,
reporting the PRIVATE_IN_PUBLIC lint, and reporting unresolved imports.
Miscellaneous post - processing including recording reexports reporting conflicts reporting the PRIVATE_IN_PUBLIC lint and reporting unresolved imports .
&mut self
module
Module<'b>
report_unresolved_imports
bool
&mut self
module
Module<'b>
report_unresolved_imports
bool