Skip to main content

Resolved

Struct Resolved 

Source
pub struct Resolved {
    pub modules: Vec<ModuleInfo>,
    pub defs: Vec<Def>,
    pub locals: Vec<Local>,
    pub res: BTreeMap<(FileId, NodeId), Res>,
    pub local_decls: BTreeMap<Span, LocalId>,
    pub members: BTreeMap<DefId, BTreeMap<String, DefId>>,
    pub impls: BTreeMap<(ModuleId, usize, usize), DefId>,
    pub diagnostics: Vec<Diagnostic>,
}
Expand description

The result of name resolution.

Fields§

§modules: Vec<ModuleInfo>

All modules, std included.

§defs: Vec<Def>

All declarations.

§locals: Vec<Local>

All locals.

§res: BTreeMap<(FileId, NodeId), Res>

What each resolved node names: Name and Field expressions, types, patterns, struct literals and the shorthand fields of struct literals and patterns.

§local_decls: BTreeMap<Span, LocalId>

The local declared at each name span (let, var, parameters, loop variables, closure parameters, pattern bindings).

§members: BTreeMap<DefId, BTreeMap<String, DefId>>

Members (variants and inherent functions) of each type.

§impls: BTreeMap<(ModuleId, usize, usize), DefId>

The type of each impl block, inherent or for an interface, keyed by module, section index and item index. Blocks whose type did not resolve are missing.

§diagnostics: Vec<Diagnostic>

Diagnostics of chapter 6.

Implementations§

Source§

impl Resolved

Source

pub fn def(&self, id: DefId) -> Option<&Def>

The declaration with this id.

Trait Implementations§

Source§

impl Debug for Resolved

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Resolved

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.