Skip to main content

CheckedModule

Struct CheckedModule 

Source
pub struct CheckedModule {
    pub canonical: Module,
    pub ir: Module,
}
Expand description

One module the checks built a tree for, in both the forms the compiler still needs it. Whether it passed them is said beside it: by check_module’s Ok, or by the empty error list of check_module_recovering’s Outcome::Module.

The two halves answer different questions and neither is derivable from the other. canonical is what an Interface is built from, so the modules that import this one are checked against it; ir is what a backend reads, and carries the solved types, the name kinds, the arities and the constructor positions that emission needs and name resolution never did.

Fields§

§canonical: Module§ir: Module

Implementations§

Source§

impl CheckedModule

Source

pub fn to_interface(&self, file: Option<SourceFileId>) -> Interface

This module’s Interface — canonical::Module::to_interface, which is the half of a checked module that crosses a module boundary.

Inherent so that a caller holding a CheckedModule reaches it without importing Checked; the body is that trait’s, so there is only one to keep correct.

Trait Implementations§

Source§

impl Checked for CheckedModule

Source§

fn name(&self) -> &ModuleName

The module’s own name, package included.
Source§

fn to_interface(&self, file: Option<SourceFileId>) -> Interface

The trimmed-down view the modules that import this one are checked against. Read more
Source§

impl Debug for CheckedModule

Source§

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

Formats the value using the given formatter. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.