pub fn add_and_shadow_all(&mut self, shadowing: AliasMapBuilder) -> OldAliasMap {
        if shadowing.is_empty() {
            return OldAliasMap(None);
        }

        let outer_scope = OldAliasMap(Some(self.clone()));
        let AliasMapBuilder {
            modules: new_modules,
            members: new_members,
        } = shadowing;

        let next_depth = self.current_depth();
        let mut current_scope = AliasSet::new();
        for (alias, (ident, is_implicit)) in new_modules {
            if !is_implicit {
                current_scope.modules.add(alias).unwrap();
            }
            self.modules.remove(&alias);
            self.modules.add(alias, (Some(next_depth), ident)).unwrap();
        }
        for (alias, (ident_member, is_implicit)) in new_members {
            if !is_implicit {
                current_scope.members.add(alias).unwrap();
            }
            self.members.remove(&alias);
            self.members
                .add(alias, (Some(next_depth), ident_member))
                .unwrap();
        }
        self.unused.push(current_scope);
        outer_scope
    }
/// Adds all of the new items in the new inner scope as shadowing the outer one.
/// Gives back the outer scope
Adds all of the new items in the new inner scope as shadowing the outer one.
Gives back the outer scope
Adds all of the new items in the new inner scope as shadowing the outer one . Gives back the outer scope
pub fn add_and_shadow_all(&mut self, shadowing: AliasMapBuilder) -> OldAliasMap {
        if shadowing.is_empty() {
            return OldAliasMap(None);
        }
        let outer_scope = OldAliasMap(Some(self.clone()));
        let AliasMapBuilder {
            modules: new_modules,
            members: new_members,
        } = shadowing;
        let next_depth = self.current_depth();
        let mut current_scope = AliasSet::new();
        for (alias, (ident, is_implicit)) in new_modules {
            if !is_implicit {
                current_scope.modules.add(alias).unwrap();
            }
            self.modules.remove(&alias);
            self.modules.add(alias, (Some(next_depth), ident)).unwrap();
        }
        for (alias, (ident_member, is_implicit)) in new_members {
            if !is_implicit {
                current_scope.members.add(alias).unwrap();
            }
            self.members.remove(&alias);
            self.members
                .add(alias, (Some(next_depth), ident_member))
                .unwrap();
        }
        self.unused.push(current_scope);
        outer_scope
    }
pub fn add_and_shadow_all ( & mut self , shadowing : AliasMapBuilder ) -> OldAliasMap { if shadowing . is_empty ( ) { return OldAliasMap ( None ) ; } let outer_scope = OldAliasMap ( Some ( self . clone ( ) ) ) ; let AliasMapBuilder { modules : new_modules , members : new_members , } = shadowing ; let next_depth = self . current_depth ( ) ; let mut current_scope = AliasSet :: new ( ) ; for ( alias , ( ident , is_implicit ) ) in new_modules { if ! is_implicit { current_scope . modules . add ( alias ) . unwrap ( ) ; } self . modules . remove ( & alias ) ; self . modules . add ( alias , ( Some ( next_depth ) , ident ) ) . unwrap ( ) ; } for ( alias , ( ident_member , is_implicit ) ) in new_members { if ! is_implicit { current_scope . members . add ( alias ) . unwrap ( ) ; } self . members . remove ( & alias ) ; self . members . add ( alias , ( Some ( next_depth ) , ident_member ) ) . unwrap ( ) ; } self . unused . push ( current_scope ) ; outer_scope }
Adds all of the new items in the new inner scope as shadowing the outer one.
Adds all of the new items in the new inner scope as shadowing the outer one .
&mut self
shadowing
AliasMapBuilder