pub fn check_unused_namespace_variables(ns: &mut Namespace) {
    for contract in &ns.contracts {
        for variable in &contract.variables {
            if let Some(warning) = emit_warning_contract_variables(variable) {
                ns.diagnostics.push(warning);
            }
        }
    }

    // Global constants should have been initialized during declaration
    for constant in &ns.constants {
        if !constant.read {
            ns.diagnostics.push(Diagnostic::warning(
                constant.loc,
                format!("global constant ‘{}‘ has never been used", constant.name),
            ));
        }
    }
}
/// Check for unused constants and storage variables
Check for unused constants and storage variables
Check for unused constants and storage variables
pub fn check_unused_namespace_variables(ns: &mut Namespace) {
    for contract in &ns.contracts {
        for variable in &contract.variables {
            if let Some(warning) = emit_warning_contract_variables(variable) {
                ns.diagnostics.push(warning);
            }
        }
    }
    // Global constants should have been initialized during declaration
    for constant in &ns.constants {
        if !constant.read {
            ns.diagnostics.push(Diagnostic::warning(
                constant.loc,
                format!("global constant ‘{}‘ has never been used", constant.name),
            ));
        }
    }
}
pub fn check_unused_namespace_variables ( ns : & mut Namespace ) { for contract in & ns . contracts { for variable in & contract . variables { if let Some ( warning ) = emit_warning_contract_variables ( variable ) { ns . diagnostics . push ( warning ) ; } } } // Global constants should have been initialized during declaration for constant in & ns . constants { if ! constant . read { ns . diagnostics . push ( Diagnostic :: warning ( constant . loc , format ! ( " o tant.nam ), ) ) ; } } }
Check for unused constants and storage variables
Check for unused constants and storage variables
ns
&mut Namespace
ns
&mut Namespace