Skip to main content

luaur_analysis/methods/
scope_should_warn_global.rs

1use crate::records::scope::Scope;
2use alloc::string::String;
3
4impl Scope {
5    pub fn should_warn_global(&self, name: String) -> bool {
6        let mut current = Some(self);
7        while let Some(scope) = current {
8            if scope.globals_to_warn.contains(&name) {
9                return true;
10            }
11            current = scope.parent.as_deref();
12        }
13        false
14    }
15}