Skip to main content

luaur_analysis/methods/
stringifier_state_unsee.rs

1//! Node: `cxx:Method:Luau.Analysis:Analysis/src/ToString.cpp:201:stringifier_state_unsee`
2//! Source: `Analysis/src/ToString.cpp:201-207` (hand-ported)
3//!
4//! C++ `void unsee(const void* tv)` — really erases (Luau::Set supports
5//! erase). An earlier translation wired this to the DenseHashSet no-op
6//! `unsee`, which made every repeated sibling type print `*CYCLE*`.
7
8use crate::records::stringifier_state::StringifierState;
9use core::ffi::c_void;
10
11impl StringifierState {
12    pub fn unsee(&mut self, tv: *const c_void) {
13        let ttv = tv as *mut c_void;
14
15        if self.seen.contains(&ttv) {
16            self.seen.erase(&ttv);
17        }
18    }
19}