pub fn specialise(
modules: &mut [&mut CheckedModule],
) -> Result<(), Vec<ModuleErrors>>Expand description
Find every specialisation modules need and resolve every reference that carried
obligations, in place.
modules is the whole of a build, or at least of one tree of it: a module is read
against the others by name, and what one of them refers to that is not here is
Error::NoDeclaration or Error::NoInstance. A build that emits a second tree holding
more modules passes all of them, once: what a module of the first tree holds does not
depend on the others, since a copy is made for the module that uses it and for none
other.
The roots are every declaration with no context and every member of an instance with no context, in every module. The body of each is read, and each reference in it that carries obligations is resolved at the types it is now at: to a member of an instance directly, or to a specialisation of the module the body is in, which is read in its turn if its key is new. See the module’s documentation for what a key is and for the limit.
On Err nothing has been changed, and each error is in the bucket of the module its
labels point into, in the order the modules were handed in.