pub(crate) fn link(&self, context: &Context, diagnostics: &mut Diagnostics) {
        let inner = self.inner.borrow();

        for (hash, spans) in &inner.required_functions {
            if inner.functions.get(hash).is_none() && context.lookup(*hash).is_none() {
                diagnostics.error(
                    0,
                    LinkerError::MissingFunction {
                        hash: *hash,
                        spans: spans.clone(),
                    },
                );
            }
        }
    }
/// Try to link the unit with the context, checking that all necessary
/// functions are provided.
///
/// This can prevent a number of runtime errors, like missing functions.
Try to link the unit with the context, checking that all necessary
functions are provided.

This can prevent a number of runtime errors, like missing functions.
Try to link the unit with the context checking that all necessary functions are provided . This can prevent a number of runtime errors like missing functions .
pub(crate) fn link(&self, context: &Context, diagnostics: &mut Diagnostics) {
        let inner = self.inner.borrow();
        for (hash, spans) in &inner.required_functions {
            if inner.functions.get(hash).is_none() && context.lookup(*hash).is_none() {
                diagnostics.error(
                    0,
                    LinkerError::MissingFunction {
                        hash: *hash,
                        spans: spans.clone(),
                    },
                );
            }
        }
    }
pub ( crate ) fn link ( & self , context : & Context , diagnostics : & mut Diagnostics ) { let inner = self . inner . borrow ( ) ; for ( hash , spans ) in & inner . required_functions { if inner . functions . get ( hash ) . is_none ( ) && context . lookup ( * hash ) . is_none ( ) { diagnostics . error ( 0 , LinkerError :: MissingFunction { hash : * hash , spans : spans . clone ( ) , } , ) ; } } }
Try to link the unit with the context, checking that all necessary
functions are provided.
Try to link the unit with the context checking that all necessary functions are provided .
&self
context
&Context
diagnostics
&mut Diagnostics
&self
context
&Context
diagnostics
&mut Diagnostics