pub fn ensure_no_diagnostics<T: Debug>(diagnostics: &[T])
Checks for diagnostics and panics if it finds any.