ensure_diagnostics

Function ensure_diagnostics 

Source
pub fn ensure_diagnostics(
    db: &dyn Database,
    diagnostic_reporter: &mut DiagnosticsReporter<'_>,
) -> Result<(), DiagnosticsError>
Expand description

Checks if there are diagnostics and reports them to the provided callback as strings. Returns Err if diagnostics were found.

Note: Usually diagnostics should be checked as early as possible to avoid running into compilation errors that have not been reported to the user yet (which can result in compiler panic). This requires us to split the diagnostics warmup and function compilation warmup into two separate steps (note that we don’t usually know the ConcreteFunctionWithBodyId yet when calculating diagnostics).

Performs parallel database warmup (if possible) and calls DiagnosticsReporter::ensure.