luaur_analysis/methods/quantifier_subsumes.rs
1use crate::records::quantifier::Quantifier;
2use crate::records::scope::Scope;
3use alloc::sync::Arc;
4
5impl Quantifier {
6 pub fn subsumes(&mut self, outer: *mut Scope, inner: *mut Scope) -> bool {
7 let mut current = inner;
8 while !current.is_null() {
9 if current == outer {
10 return true;
11 }
12 current = unsafe { (*current).parent.as_ref() }
13 .map_or(std::ptr::null_mut(), |sp| Arc::as_ptr(sp) as *mut Scope);
14 }
15 false
16 }
17}