Skip to main content

Checked

Trait Checked 

Source
pub trait Checked {
    // Required methods
    fn name(&self) -> &ModuleName;
    fn to_interface(&self, file: Option<SourceFileId>) -> Interface;
}
Expand description

What dependencies::ModuleWalker::check_in_order needs of whatever its checker hands back: a name to key the module by, and the interface the modules after it are checked against.

It is a trait because the walker drives more than one checker. The compiler’s is check_module_recovering, which answers with a CheckedModule; crates/zelkova-compiler/tests/spec.rs drives the same walker with a checker that only canonicalizes, because a spec example is judged on the errors each phase reports and there is nothing to emit from it.

Required Methods§

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.

file is where this module was read from, when the caller knows it — see Interface::file.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§