pub struct DependencyAnalysis {
pub sccs: Vec<Vec<String>>,
/* private fields */
}Expand description
Result of dependency analysis.
Fields§
§sccs: Vec<Vec<String>>Strongly connected components in reverse topological order.
sccs[0]has no dependencies (or depends only on things not in this list).sccs.last()depends on everything else.- Definitions within an SCC are mutually recursive.
- Every definition in the symbol table appears exactly once.
Implementations§
Source§impl DependencyAnalysis
impl DependencyAnalysis
Sourcepub fn def_id_by_symbol(&self, sym: Symbol) -> Option<DefId>
pub fn def_id_by_symbol(&self, sym: Symbol) -> Option<DefId>
Get the DefId for a definition by Symbol.
Sourcepub fn def_id(&self, interner: &Interner, name: &str) -> Option<DefId>
pub fn def_id(&self, interner: &Interner, name: &str) -> Option<DefId>
Get the DefId for a definition name (requires interner for lookup).
Sourcepub fn def_name_sym(&self, id: DefId) -> Symbol
pub fn def_name_sym(&self, id: DefId) -> Symbol
Get the name Symbol for a DefId.
Sourcepub fn def_name<'a>(&self, interner: &'a Interner, id: DefId) -> &'a str
pub fn def_name<'a>(&self, interner: &'a Interner, id: DefId) -> &'a str
Get the name string for a DefId.
Sourcepub fn name_to_def(&self) -> &HashMap<Symbol, DefId>
pub fn name_to_def(&self) -> &HashMap<Symbol, DefId>
Get the name_to_def map (for seeding TypeContext).
Sourcepub fn is_recursive(&self, name: &str) -> bool
pub fn is_recursive(&self, name: &str) -> bool
Returns true if this definition is recursive.
A definition is recursive if it’s part of a mutual recursion group (SCC > 1), or it’s a single definition that references itself.
Trait Implementations§
Source§impl Clone for DependencyAnalysis
impl Clone for DependencyAnalysis
Source§fn clone(&self) -> DependencyAnalysis
fn clone(&self) -> DependencyAnalysis
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DependencyAnalysis
impl Debug for DependencyAnalysis
Source§impl Default for DependencyAnalysis
impl Default for DependencyAnalysis
Source§fn default() -> DependencyAnalysis
fn default() -> DependencyAnalysis
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DependencyAnalysis
impl RefUnwindSafe for DependencyAnalysis
impl Send for DependencyAnalysis
impl Sync for DependencyAnalysis
impl Unpin for DependencyAnalysis
impl UnwindSafe for DependencyAnalysis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more