1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! The [DeclEngine](engine::DeclEngine) allows the compiler to add a layer of
//! separation between [AST nodes](crate::semantic_analysis::ast_node) and
//! declarations.
//!
//! As an interface, you can think of the [DeclEngine](engine::DeclEngine) as a
//! mapping from [DeclId](id::DeclId) to [DeclWrapper](wrapper::DeclWrapper).
//! When a [DeclWrapper](wrapper::DeclWrapper) is inserted into the
//! [DeclEngine](engine::DeclEngine), a [DeclId](id::DeclId) is generated, which
//! is then used to refer to the declaration.

pub mod associated_item_decl_id;
#[allow(clippy::module_inception)]
pub(crate) mod engine;
pub mod id;
pub(crate) mod interface_decl_id;
pub(crate) mod mapping;
pub(crate) mod parsed_engine;
pub mod parsed_id;
pub(crate) mod r#ref;
pub(crate) mod replace_decls;

use std::collections::BTreeMap;

pub(crate) use associated_item_decl_id::*;
pub use engine::*;
pub(crate) use id::*;
pub use interface_decl_id::*;
pub(crate) use mapping::*;
pub use r#ref::*;
pub(crate) use replace_decls::*;
use sway_types::Ident;

use crate::{
    language::ty::{TyTraitInterfaceItem, TyTraitItem},
    TypeId,
};

pub(crate) type InterfaceItemMap = BTreeMap<(Ident, TypeId), TyTraitInterfaceItem>;
pub(crate) type ItemMap = BTreeMap<(Ident, TypeId), TyTraitItem>;