unsafe fn mlir_diagnostic_to_string(diag: MlirDiagnostic) -> String {
    unsafe extern "C" fn stringify_callback(string: MlirStringRef, to: *mut std::ffi::c_void) {
        let to: &mut String = (to as *mut String).as_mut().unwrap();
        to.push_str(
            std::str::from_utf8(std::slice::from_raw_parts(
                string.data as *const _,
                string.length as usize,
            ))
            .expect("utf8 string"),
        );
    }
    let mut string = String::new();
    mlirDiagnosticPrint(
        diag,
        Some(stringify_callback),
        &mut string as *mut _ as *mut _,
    );
    string
}
/// Convert the message in an MLIR diagnostic to a string.
Convert the message in an MLIR diagnostic to a string.
Convert the message in an MLIR diagnostic to a string .
unsafe fn mlir_diagnostic_to_string(diag: MlirDiagnostic) -> String {
    unsafe extern "C" fn stringify_callback(string: MlirStringRef, to: *mut std::ffi::c_void) {
        let to: &mut String = (to as *mut String).as_mut().unwrap();
        to.push_str(
            std::str::from_utf8(std::slice::from_raw_parts(
                string.data as *const _,
                string.length as usize,
            ))
            .expect("utf8 string"),
        );
    }
    let mut string = String::new();
    mlirDiagnosticPrint(
        diag,
        Some(stringify_callback),
        &mut string as *mut _ as *mut _,
    );
    string
}
unsafe fn mlir_diagnostic_to_string ( diag : MlirDiagnostic ) -> String { unsafe extern " " fn stringify_callback ( string : MlirStringRef , to : * mut std :: ffi :: c_void ) { let to : & mut String = ( to as * mut String ) . as_mut ( ) . unwrap ( ) ; to . push_str ( std :: str :: from_utf8 ( std :: slice :: from_raw_parts ( string . data as * const _ , string . length as usize , ) ) . expect ( " " ) , ) ; } let mut string = String :: new ( ) ; mlirDiagnosticPrint ( diag , Some ( stringify_callback ) , & mut string as * mut _ as * mut _ , ) ; string }
Convert the message in an MLIR diagnostic to a string.
Convert the message in an MLIR diagnostic to a string .
diag
MlirDiagnostic
diag
MlirDiagnostic