1/// Checks for diagnostics and panics if it finds any. 2pub fn ensure_no_diagnostics<T: std::fmt::Debug>(diagnostics: &[T]) { 3 if let Some(diagnostic) = diagnostics.first() { 4 panic!("Diagnostic error: {:?}", diagnostic); 5 } 6}