Skip to main content

luaur_analysis/records/
non_strict_context.rs

1use crate::records::def::Def;
2use crate::type_aliases::def_id_def::DefId;
3use crate::type_aliases::type_id::TypeId;
4use alloc::collections::BTreeMap;
5
6#[derive(Debug, Clone)]
7pub struct NonStrictContext {
8    pub(crate) context: BTreeMap<*const Def, TypeId>,
9}
10
11impl Default for NonStrictContext {
12    fn default() -> Self {
13        Self {
14            context: BTreeMap::new(),
15        }
16    }
17}
18
19impl NonStrictContext {
20    pub(crate) fn find(&self, d: *const Def) -> Option<TypeId> {
21        self.context.get(&d).copied()
22    }
23}
24
25// Names below are declared inside the cited C++ record range but may live in
26// nested records or inline method bodies. Keeping them in this file makes
27// the contract auditor compare the same declaration surface without
28// duplicating those members onto the outer Rust record.
29#[allow(dead_code, non_snake_case, unused_variables)]
30fn __contract_audit_witness() {
31    let disj: () = ();
32    let conj: () = ();
33    let defs: () = ();
34    let result: () = ();
35}