fn local_variable(&mut self, name: &str, ty: Type) -> VariableId {
        let id = self.vars.locals.len();

        let name = if name.is_empty() {
            String::new()
        } else {
            name.to_string()
        };

        self.vars.locals.push(Variable { name, ty });

        VariableId {
            id,
            kind: VariableAllocationContext::Local,
        }
    }
/// creates an immutable local variable that is unused
creates an immutable local variable that is unused
creates an immutable local variable that is unused
fn local_variable(&mut self, name: &str, ty: Type) -> VariableId {
        let id = self.vars.locals.len();
        let name = if name.is_empty() {
            String::new()
        } else {
            name.to_string()
        };
        self.vars.locals.push(Variable { name, ty });
        VariableId {
            id,
            kind: VariableAllocationContext::Local,
        }
    }
fn local_variable ( & mut self , name : & str , ty : Type ) -> VariableId { let id = self . vars . locals . len ( ) ; let name = if name . is_empty ( ) { String :: new ( ) } else { name . to_string ( ) } ; self . vars . locals . push ( Variable { name , ty } ) ; VariableId { id , kind : VariableAllocationContext :: Local , } }
creates an immutable local variable that is unused
creates an immutable local variable that is unused
&mut self
name
&str
ty
Type
&mut self
name
&str
ty
Type