pub fn with_scope<F, R>(&self, scope: ScopeRef, f: F) -> Result<R>
    where
        F: FnOnce(&mut Scope) -> Result<R>,
    {
        let mut tbl = self.sb.scope2_table.borrow_mut();
        let scp = match tbl.get_mut(&scope) {
            Some(s) => s,
            None => {
                self.emit(DiagBuilder2::bug(format!(
                    "scope {:?} does not exist`",
                    scope
                )));
                return Err(());
            }
        };
        f(scp)
    }
/// Lookup a scope and perform an operation on it.
Lookup a scope and perform an operation on it.
Lookup a scope and perform an operation on it .
pub fn with_scope<F, R>(&self, scope: ScopeRef, f: F) -> Result<R>
    where
        F: FnOnce(&mut Scope) -> Result<R>,
    {
        let mut tbl = self.sb.scope2_table.borrow_mut();
        let scp = match tbl.get_mut(&scope) {
            Some(s) => s,
            None => {
                self.emit(DiagBuilder2::bug(format!(
                    "scope {:?} does not exist`",
                    scope
                )));
                return Err(());
            }
        };
        f(scp)
    }
pub fn with_scope < F , R > ( & self , scope : ScopeRef , f : F ) -> Result < R > where F : FnOnce ( & mut Scope ) -> Result < R > , { let mut tbl = self . sb . scope2_table . borrow_mut ( ) ; let scp = match tbl . get_mut ( & scope ) { Some ( s ) => s , None => { self . emit ( DiagBuilder2 :: bug ( format ! ( " " scope ) ) ) ; return Err ( ( ) ) ; } } ; f ( scp ) }
Lookup a scope and perform an operation on it.
Lookup a scope and perform an operation on it .
&self
scope
ScopeRef
f
F
&self
scope
ScopeRef
f
F